[STATEMENT]
lemma holds_of_OR [simp]:
  assumes fin: "finite (\<Phi>::'a pltl set)"
  shows "(\<sigma> \<Turnstile>\<^sub>p OR \<Phi>) = (\<exists>\<phi>\<in>\<Phi>. \<sigma> \<Turnstile>\<^sub>p \<phi>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<sigma> \<Turnstile>\<^sub>p OR \<Phi> = (\<exists>\<phi>\<in>\<Phi>. \<sigma> \<Turnstile>\<^sub>p \<phi>)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<sigma> \<Turnstile>\<^sub>p OR \<Phi> = (\<exists>\<phi>\<in>\<Phi>. \<sigma> \<Turnstile>\<^sub>p \<phi>)
[PROOF STEP]
{
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<sigma> \<Turnstile>\<^sub>p OR \<Phi> = (\<exists>\<phi>\<in>\<Phi>. \<sigma> \<Turnstile>\<^sub>p \<phi>)
[PROOF STEP]
fix \<psi>::"'a pltl"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<sigma> \<Turnstile>\<^sub>p OR \<Phi> = (\<exists>\<phi>\<in>\<Phi>. \<sigma> \<Turnstile>\<^sub>p \<phi>)
[PROOF STEP]
assume "fold_graph Or_ltlp False_ltlp \<Phi> \<psi>"
[PROOF STATE]
proof (state)
this:
fold_graph Or_ltlp false\<^sub>p \<Phi> \<psi>

goal (1 subgoal):
 1. \<sigma> \<Turnstile>\<^sub>p OR \<Phi> = (\<exists>\<phi>\<in>\<Phi>. \<sigma> \<Turnstile>\<^sub>p \<phi>)
[PROOF STEP]
hence "(\<sigma> \<Turnstile>\<^sub>p \<psi>) = (\<exists>\<phi>\<in>\<Phi>. \<sigma> \<Turnstile>\<^sub>p \<phi>)"
[PROOF STATE]
proof (prove)
using this:
fold_graph Or_ltlp false\<^sub>p \<Phi> \<psi>

goal (1 subgoal):
 1. \<sigma> \<Turnstile>\<^sub>p \<psi> = (\<exists>\<phi>\<in>\<Phi>. \<sigma> \<Turnstile>\<^sub>p \<phi>)
[PROOF STEP]
by (rule fold_graph.induct) auto
[PROOF STATE]
proof (state)
this:
\<sigma> \<Turnstile>\<^sub>p \<psi> = (\<exists>\<phi>\<in>\<Phi>. \<sigma> \<Turnstile>\<^sub>p \<phi>)

goal (1 subgoal):
 1. \<sigma> \<Turnstile>\<^sub>p OR \<Phi> = (\<exists>\<phi>\<in>\<Phi>. \<sigma> \<Turnstile>\<^sub>p \<phi>)
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
fold_graph Or_ltlp false\<^sub>p \<Phi> ?\<psi>2 \<Longrightarrow> \<sigma> \<Turnstile>\<^sub>p ?\<psi>2 = (\<exists>\<phi>\<in>\<Phi>. \<sigma> \<Turnstile>\<^sub>p \<phi>)

goal (1 subgoal):
 1. \<sigma> \<Turnstile>\<^sub>p OR \<Phi> = (\<exists>\<phi>\<in>\<Phi>. \<sigma> \<Turnstile>\<^sub>p \<phi>)
[PROOF STEP]
with fold_graph_OR[OF fin]
[PROOF STATE]
proof (chain)
picking this:
fold_graph Or_ltlp false\<^sub>p \<Phi> (OR \<Phi>)
fold_graph Or_ltlp false\<^sub>p \<Phi> ?\<psi>2 \<Longrightarrow> \<sigma> \<Turnstile>\<^sub>p ?\<psi>2 = (\<exists>\<phi>\<in>\<Phi>. \<sigma> \<Turnstile>\<^sub>p \<phi>)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
fold_graph Or_ltlp false\<^sub>p \<Phi> (OR \<Phi>)
fold_graph Or_ltlp false\<^sub>p \<Phi> ?\<psi>2 \<Longrightarrow> \<sigma> \<Turnstile>\<^sub>p ?\<psi>2 = (\<exists>\<phi>\<in>\<Phi>. \<sigma> \<Turnstile>\<^sub>p \<phi>)

goal (1 subgoal):
 1. \<sigma> \<Turnstile>\<^sub>p OR \<Phi> = (\<exists>\<phi>\<in>\<Phi>. \<sigma> \<Turnstile>\<^sub>p \<phi>)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<sigma> \<Turnstile>\<^sub>p OR \<Phi> = (\<exists>\<phi>\<in>\<Phi>. \<sigma> \<Turnstile>\<^sub>p \<phi>)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma p'_pos_iff: "p' x > 0 \<longleftrightarrow> (if a > 0 then x > -v / a else if a < 0 then x < -v / a else v > 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (0 < p' x) = (if 0 < a then - v / a < x else if a < 0 then x < - v / a else 0 < v)
[PROOF STEP]
by (auto simp: p'_def field_split_simps)


[STATEMENT]
lemma fps_gcd:
  assumes [simp]: "f \<noteq> 0" "g \<noteq> 0"
  shows   "gcd f g = fps_X ^ min (subdegree f) (subdegree g)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. gcd f g = fps_X ^ min (subdegree f) (subdegree g)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. gcd f g = fps_X ^ min (subdegree f) (subdegree g)
[PROOF STEP]
let ?m = "min (subdegree f) (subdegree g)"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. gcd f g = fps_X ^ min (subdegree f) (subdegree g)
[PROOF STEP]
show "gcd f g = fps_X ^ ?m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. gcd f g = fps_X ^ min (subdegree f) (subdegree g)
[PROOF STEP]
proof (rule sym, rule gcdI)
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. fps_X ^ min (subdegree f) (subdegree g) dvd f
 2. fps_X ^ min (subdegree f) (subdegree g) dvd g
 3. \<And>d. \<lbrakk>d dvd f; d dvd g\<rbrakk> \<Longrightarrow> d dvd fps_X ^ min (subdegree f) (subdegree g)
 4. normalize (fps_X ^ min (subdegree f) (subdegree g)) = fps_X ^ min (subdegree f) (subdegree g)
[PROOF STEP]
fix d
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. fps_X ^ min (subdegree f) (subdegree g) dvd f
 2. fps_X ^ min (subdegree f) (subdegree g) dvd g
 3. \<And>d. \<lbrakk>d dvd f; d dvd g\<rbrakk> \<Longrightarrow> d dvd fps_X ^ min (subdegree f) (subdegree g)
 4. normalize (fps_X ^ min (subdegree f) (subdegree g)) = fps_X ^ min (subdegree f) (subdegree g)
[PROOF STEP]
assume "d dvd f" "d dvd g"
[PROOF STATE]
proof (state)
this:
d dvd f
d dvd g

goal (4 subgoals):
 1. fps_X ^ min (subdegree f) (subdegree g) dvd f
 2. fps_X ^ min (subdegree f) (subdegree g) dvd g
 3. \<And>d. \<lbrakk>d dvd f; d dvd g\<rbrakk> \<Longrightarrow> d dvd fps_X ^ min (subdegree f) (subdegree g)
 4. normalize (fps_X ^ min (subdegree f) (subdegree g)) = fps_X ^ min (subdegree f) (subdegree g)
[PROOF STEP]
thus "d dvd fps_X ^ ?m"
[PROOF STATE]
proof (prove)
using this:
d dvd f
d dvd g

goal (1 subgoal):
 1. d dvd fps_X ^ min (subdegree f) (subdegree g)
[PROOF STEP]
by (cases "d = 0") (simp_all add: fps_dvd_iff)
[PROOF STATE]
proof (state)
this:
d dvd fps_X ^ min (subdegree f) (subdegree g)

goal (3 subgoals):
 1. fps_X ^ min (subdegree f) (subdegree g) dvd f
 2. fps_X ^ min (subdegree f) (subdegree g) dvd g
 3. normalize (fps_X ^ min (subdegree f) (subdegree g)) = fps_X ^ min (subdegree f) (subdegree g)
[PROOF STEP]
qed (simp_all add: fps_dvd_iff)
[PROOF STATE]
proof (state)
this:
gcd f g = fps_X ^ min (subdegree f) (subdegree g)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma unat_of_nat:
  \<open>unat (word_of_nat x :: 'a::len word) = x mod 2 ^ LENGTH('a)\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. unat (word_of_nat x) = x mod 2 ^ LENGTH('a)
[PROOF STEP]
by transfer (simp flip: take_bit_eq_mod add: nat_take_bit_eq)


[STATEMENT]
lemma forall_vector_1: "(\<forall>v::'a::zero^1. P v) \<longleftrightarrow> (\<forall>x. P(vector[x]))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>v. P v) = (\<forall>x. P (vector [x]))
[PROOF STEP]
by (metis vector_1 vector_one)


[STATEMENT]
lemma ceiling_divide_upper:
  fixes q :: "'a::floor_ceiling"
  shows "q > 0 \<Longrightarrow> p \<le> of_int (ceiling (p / q)) * q"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (0::'a) < q \<Longrightarrow> p \<le> of_int \<lceil>p / q\<rceil> * q
[PROOF STEP]
by (meson divide_le_eq le_of_int_ceiling)


[STATEMENT]
lemma bag_of_append [simp]: "bag_of (l@l') = bag_of l + bag_of l'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mset (l @ l') = mset l + mset l'
[PROOF STEP]
by (fact mset_append)


[STATEMENT]
lemma iso_semicategory_sym[sym]:
  assumes "\<AA> \<approx>\<^sub>S\<^sub>M\<^sub>C\<^bsub>\<alpha>\<^esub> \<BB>"
  shows "\<BB> \<approx>\<^sub>S\<^sub>M\<^sub>C\<^bsub>\<alpha>\<^esub> \<AA>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<BB> \<approx>\<^sub>S\<^sub>M\<^sub>C\<^bsub>\<alpha>\<^esub> \<AA>
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<BB> \<approx>\<^sub>S\<^sub>M\<^sub>C\<^bsub>\<alpha>\<^esub> \<AA>
[PROOF STEP]
interpret iso_semicategory \<alpha> \<AA> \<BB>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<AA> \<approx>\<^sub>S\<^sub>M\<^sub>C\<^bsub>\<alpha>\<^esub> \<BB>
[PROOF STEP]
by (rule assms)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<BB> \<approx>\<^sub>S\<^sub>M\<^sub>C\<^bsub>\<alpha>\<^esub> \<AA>
[PROOF STEP]
from iso_smc_is_iso_semifunctor
[PROOF STATE]
proof (chain)
picking this:
\<exists>\<FF>. \<FF> : \<AA> \<mapsto>\<mapsto>\<^sub>S\<^sub>M\<^sub>C\<^sub>.\<^sub>i\<^sub>s\<^sub>o\<^bsub>\<alpha>\<^esub> \<BB>
[PROOF STEP]
obtain \<FF> where "\<FF> : \<AA> \<mapsto>\<mapsto>\<^sub>S\<^sub>M\<^sub>C\<^sub>.\<^sub>i\<^sub>s\<^sub>o\<^bsub>\<alpha>\<^esub> \<BB>"
[PROOF STATE]
proof (prove)
using this:
\<exists>\<FF>. \<FF> : \<AA> \<mapsto>\<mapsto>\<^sub>S\<^sub>M\<^sub>C\<^sub>.\<^sub>i\<^sub>s\<^sub>o\<^bsub>\<alpha>\<^esub> \<BB>

goal (1 subgoal):
 1. (\<And>\<FF>. \<FF> : \<AA> \<mapsto>\<mapsto>\<^sub>S\<^sub>M\<^sub>C\<^sub>.\<^sub>i\<^sub>s\<^sub>o\<^bsub>\<alpha>\<^esub> \<BB> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by clarsimp
[PROOF STATE]
proof (state)
this:
\<FF> : \<AA> \<mapsto>\<mapsto>\<^sub>S\<^sub>M\<^sub>C\<^sub>.\<^sub>i\<^sub>s\<^sub>o\<^bsub>\<alpha>\<^esub> \<BB>

goal (1 subgoal):
 1. \<BB> \<approx>\<^sub>S\<^sub>M\<^sub>C\<^bsub>\<alpha>\<^esub> \<AA>
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<FF> : \<AA> \<mapsto>\<mapsto>\<^sub>S\<^sub>M\<^sub>C\<^sub>.\<^sub>i\<^sub>s\<^sub>o\<^bsub>\<alpha>\<^esub> \<BB>
[PROOF STEP]
have "inv_smcf \<FF> : \<BB> \<mapsto>\<mapsto>\<^sub>S\<^sub>M\<^sub>C\<^sub>.\<^sub>i\<^sub>s\<^sub>o\<^bsub>\<alpha>\<^esub> \<AA>"
[PROOF STATE]
proof (prove)
using this:
\<FF> : \<AA> \<mapsto>\<mapsto>\<^sub>S\<^sub>M\<^sub>C\<^sub>.\<^sub>i\<^sub>s\<^sub>o\<^bsub>\<alpha>\<^esub> \<BB>

goal (1 subgoal):
 1. inv_dghm \<FF> : \<BB> \<mapsto>\<mapsto>\<^sub>S\<^sub>M\<^sub>C\<^sub>.\<^sub>i\<^sub>s\<^sub>o\<^bsub>\<alpha>\<^esub> \<AA>
[PROOF STEP]
by (simp add: is_iso_semifunctor_is_iso_arr(1))
[PROOF STATE]
proof (state)
this:
inv_dghm \<FF> : \<BB> \<mapsto>\<mapsto>\<^sub>S\<^sub>M\<^sub>C\<^sub>.\<^sub>i\<^sub>s\<^sub>o\<^bsub>\<alpha>\<^esub> \<AA>

goal (1 subgoal):
 1. \<BB> \<approx>\<^sub>S\<^sub>M\<^sub>C\<^bsub>\<alpha>\<^esub> \<AA>
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
inv_dghm \<FF> : \<BB> \<mapsto>\<mapsto>\<^sub>S\<^sub>M\<^sub>C\<^sub>.\<^sub>i\<^sub>s\<^sub>o\<^bsub>\<alpha>\<^esub> \<AA>
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
inv_dghm \<FF> : \<BB> \<mapsto>\<mapsto>\<^sub>S\<^sub>M\<^sub>C\<^sub>.\<^sub>i\<^sub>s\<^sub>o\<^bsub>\<alpha>\<^esub> \<AA>

goal (1 subgoal):
 1. \<BB> \<approx>\<^sub>S\<^sub>M\<^sub>C\<^bsub>\<alpha>\<^esub> \<AA>
[PROOF STEP]
by (auto intro: iso_semicategoryI)
[PROOF STATE]
proof (state)
this:
\<BB> \<approx>\<^sub>S\<^sub>M\<^sub>C\<^bsub>\<alpha>\<^esub> \<AA>

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma desargues_config_not_col_11:
  assumes "desargues_config A B C A' B' C' M N P R"
  shows "\<not> col C A A'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> col C A A'
[PROOF STEP]
using assms desargues_config_not_col_7 desargues_config_rot_CW
[PROOF STATE]
proof (prove)
using this:
desargues_config A B C A' B' C' M N P R
desargues_config ?A ?B ?C ?A' ?B' ?C' ?M ?N ?P ?R \<Longrightarrow> \<not> col ?A ?B ?B'
desargues_config ?A ?B ?C ?A' ?B' ?C' ?M ?N ?P ?R \<Longrightarrow> desargues_config ?C ?A ?B ?C' ?A' ?B' ?P ?M ?N ?R

goal (1 subgoal):
 1. \<not> col C A A'
[PROOF STEP]
by blast


[STATEMENT]
lemma sum_radd_commutative: "(\<Sum>t=0..(q::nat). \<Sum>R+ p l (\<lambda>k. f k t)) = (\<Sum>R+ p l (\<lambda>k. \<Sum>t=0..q. f k t))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>t = 0..q. \<Sum>R+ p l (\<lambda>k. f k t)) = \<Sum>R+ p l (\<lambda>k. sum (f k) {0..q})
[PROOF STEP]
by (rule sum_commutative sum_radd.simps) +


[STATEMENT]
lemma angles:
  "angle b1 a1 c1 = angle b2 a2 c2" "angle a1 b1 c1 = angle a2 b2 c2" "angle a1 c1 b1 = angle a2 c2 b2"
  "angle c1 a1 b1 = angle b2 a2 c2" "angle c1 b1 a1 = angle a2 b2 c2" "angle b1 c1 a1 = angle a2 c2 b2"
  "angle b1 a1 c1 = angle c2 a2 b2" "angle a1 b1 c1 = angle c2 b2 a2" "angle a1 c1 b1 = angle b2 c2 a2"
  "angle c1 a1 b1 = angle c2 a2 b2" "angle c1 b1 a1 = angle c2 b2 a2" "angle b1 c1 a1 = angle b2 c2 a2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((angle b1 a1 c1 = angle b2 a2 c2 &&& angle a1 b1 c1 = angle a2 b2 c2 &&& angle a1 c1 b1 = angle a2 c2 b2) &&& angle c1 a1 b1 = angle b2 a2 c2 &&& angle c1 b1 a1 = angle a2 b2 c2 &&& angle b1 c1 a1 = angle a2 c2 b2) &&& (angle b1 a1 c1 = angle c2 a2 b2 &&& angle a1 b1 c1 = angle c2 b2 a2 &&& angle a1 c1 b1 = angle b2 c2 a2) &&& angle c1 a1 b1 = angle c2 a2 b2 &&& angle c1 b1 a1 = angle c2 b2 a2 &&& angle b1 c1 a1 = angle b2 c2 a2
[PROOF STEP]
using angles'
[PROOF STATE]
proof (prove)
using this:
angle b1 a1 c1 = angle b2 a2 c2
angle a1 b1 c1 = angle a2 b2 c2
angle a1 c1 b1 = angle a2 c2 b2

goal (1 subgoal):
 1. ((angle b1 a1 c1 = angle b2 a2 c2 &&& angle a1 b1 c1 = angle a2 b2 c2 &&& angle a1 c1 b1 = angle a2 c2 b2) &&& angle c1 a1 b1 = angle b2 a2 c2 &&& angle c1 b1 a1 = angle a2 b2 c2 &&& angle b1 c1 a1 = angle a2 c2 b2) &&& (angle b1 a1 c1 = angle c2 a2 b2 &&& angle a1 b1 c1 = angle c2 b2 a2 &&& angle a1 c1 b1 = angle b2 c2 a2) &&& angle c1 a1 b1 = angle c2 a2 b2 &&& angle c1 b1 a1 = angle c2 b2 a2 &&& angle b1 c1 a1 = angle b2 c2 a2
[PROOF STEP]
by (simp_all add: angle_commute)


[STATEMENT]
lemma distance0_at_most_sd3r:
  "distance0 \<le> safe_distance_3r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. distance0 \<le> safe_distance_3r
[PROOF STEP]
unfolding distance0_def safe_distance_3r_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. v\<^sub>e * \<delta> - v\<^sub>o * \<delta> - a\<^sub>o * \<delta>\<^sup>2 / 2 \<le> v\<^sub>e * \<delta> - v\<^sub>e\<^sup>2 / 2 / a\<^sub>e - v\<^sub>o * \<delta> - 1 / 2 * a\<^sub>o * \<delta>\<^sup>2
[PROOF STEP]
using nonneg_vel_ego decelerate_ego
[PROOF STATE]
proof (prove)
using this:
0 \<le> v\<^sub>e
a\<^sub>e < 0

goal (1 subgoal):
 1. v\<^sub>e * \<delta> - v\<^sub>o * \<delta> - a\<^sub>o * \<delta>\<^sup>2 / 2 \<le> v\<^sub>e * \<delta> - v\<^sub>e\<^sup>2 / 2 / a\<^sub>e - v\<^sub>o * \<delta> - 1 / 2 * a\<^sub>o * \<delta>\<^sup>2
[PROOF STEP]
by (auto simp add:field_simps)


[STATEMENT]
lemma Ipoly_fst_tmf_polys:
  "Ipoly xs (fst (tmf_polys z)) = (\<Sum>i<length z. xs ! 0 ^ i * (mid (z ! i)))"
  for xs::"real list"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Ipoly xs (map_poly real_of_float (fst (tmf_polys z))) = (\<Sum>i<length z. xs ! 0 ^ i * real_of_float (mid (z ! i)))
[PROOF STEP]
proof (induction z)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. Ipoly xs (map_poly real_of_float (fst (tmf_polys []))) = (\<Sum>i<length []. xs ! 0 ^ i * real_of_float (mid ([] ! i)))
 2. \<And>a z. Ipoly xs (map_poly real_of_float (fst (tmf_polys z))) = (\<Sum>i<length z. xs ! 0 ^ i * real_of_float (mid (z ! i))) \<Longrightarrow> Ipoly xs (map_poly real_of_float (fst (tmf_polys (a # z)))) = (\<Sum>i<length (a # z). xs ! 0 ^ i * real_of_float (mid ((a # z) ! i)))
[PROOF STEP]
case (Cons z zs)
[PROOF STATE]
proof (state)
this:
Ipoly xs (map_poly real_of_float (fst (tmf_polys zs))) = (\<Sum>i<length zs. xs ! 0 ^ i * real_of_float (mid (zs ! i)))

goal (2 subgoals):
 1. Ipoly xs (map_poly real_of_float (fst (tmf_polys []))) = (\<Sum>i<length []. xs ! 0 ^ i * real_of_float (mid ([] ! i)))
 2. \<And>a z. Ipoly xs (map_poly real_of_float (fst (tmf_polys z))) = (\<Sum>i<length z. xs ! 0 ^ i * real_of_float (mid (z ! i))) \<Longrightarrow> Ipoly xs (map_poly real_of_float (fst (tmf_polys (a # z)))) = (\<Sum>i<length (a # z). xs ! 0 ^ i * real_of_float (mid ((a # z) ! i)))
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Ipoly xs (map_poly real_of_float (fst (tmf_polys (z # zs)))) = (\<Sum>i<length (z # zs). xs ! 0 ^ i * real_of_float (mid ((z # zs) ! i)))
[PROOF STEP]
unfolding list.size add_Suc_right sum.lessThan_Suc_shift
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Ipoly xs (map_poly real_of_float (fst (tmf_polys (z # zs)))) = xs ! 0 ^ 0 * real_of_float (mid ((z # zs) ! 0)) + (\<Sum>i<length zs + 0. xs ! 0 ^ Suc i * real_of_float (mid ((z # zs) ! Suc i)))
[PROOF STEP]
by (auto simp: split_beta' Let_def nth_Cons Cons sum_distrib_left ac_simps)
[PROOF STATE]
proof (state)
this:
Ipoly xs (map_poly real_of_float (fst (tmf_polys (z # zs)))) = (\<Sum>i<length (z # zs). xs ! 0 ^ i * real_of_float (mid ((z # zs) ! i)))

goal (1 subgoal):
 1. Ipoly xs (map_poly real_of_float (fst (tmf_polys []))) = (\<Sum>i<length []. xs ! 0 ^ i * real_of_float (mid ([] ! i)))
[PROOF STEP]
qed simp


[STATEMENT]
lemma invertible_Gauss_Jordan:
  fixes A::"'a::{field}^'n::{mod_type}^'m::{mod_type}"
  shows "\<exists>P. invertible P \<and> (Gauss_Jordan A) = P**A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>P. invertible P \<and> Gauss_Jordan A = P ** A
[PROOF STEP]
unfolding Gauss_Jordan_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>P. invertible P \<and> Gauss_Jordan_upt_k A (ncols A - 1) = P ** A
[PROOF STEP]
using invertible_Gauss_Jordan_up_to_k
[PROOF STATE]
proof (prove)
using this:
\<exists>P. invertible P \<and> Gauss_Jordan_upt_k ?A ?k = P ** ?A

goal (1 subgoal):
 1. \<exists>P. invertible P \<and> Gauss_Jordan_upt_k A (ncols A - 1) = P ** A
[PROOF STEP]
.


[STATEMENT]
lemma map_of_map_prop:
  "\<lbrakk>map_of (map f xs) k = Some v; \<forall>x \<in> set xs. P1 x; \<forall>x. P1 x \<longrightarrow> P2 (f x)\<rbrakk> \<Longrightarrow> P2 (k, v)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>map_of (map f xs) k = Some v; \<forall>x\<in>set xs. P1 x; \<forall>x. P1 x \<longrightarrow> P2 (f x)\<rbrakk> \<Longrightarrow> P2 (k, v)
[PROOF STEP]
by (induct xs) (auto split: if_split_asm)


[STATEMENT]
lemma dropWhile_eq_drop: "dropWhile P xs = drop (length (takeWhile P xs)) xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dropWhile P xs = drop (length (takeWhile P xs)) xs
[PROOF STEP]
by (induct xs) auto


[STATEMENT]
lemma iT_Plus_neg_Int: "(A \<inter> B) \<oplus>- k = (A \<oplus>- k) \<inter> (B \<oplus>- k)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A \<inter> B \<oplus>- k = (A \<oplus>- k) \<inter> (B \<oplus>- k)
[PROOF STEP]
by (fastforce simp: iT_Plus_neg_def)


[STATEMENT]
lemma  "check_OR (x0,x1) (a0,a1) s ((e0,z0), (e1,z1))
             = (s = e0 \<oplus> e1
                   \<and> e0 \<in> challenge_space \<and> e1 \<in> challenge_space
                      \<and> check0 x0 a0 e0 z0 \<and> check1 x1 a1 e1 z1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. check_OR (x0, x1) (a0, a1) s ((e0, z0), e1, z1) = (s = e0 \<oplus> e1 \<and> e0 \<in> challenge_space \<and> e1 \<in> challenge_space \<and> check0 x0 a0 e0 z0 \<and> check1 x1 a1 e1 z1)
[PROOF STEP]
by(simp add: check_OR_def)


[STATEMENT]
lemma bounded_coeffs_imp_fds_abs_converges':
  fixes s :: "'a :: dirichlet_series" and f :: "'a fds"
  assumes "Bseq (\<lambda>n. fds_nth f n * nat_power n s0)" "s \<bullet> 1 > 1 - s0 \<bullet> 1"
  shows   "fds_abs_converges f s"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fds_abs_converges f s
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. fds_abs_converges f s
[PROOF STEP]
have "fds_nth (fds_shift s0 f) = (\<lambda>n. fds_nth f n * nat_power n s0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fds_nth (fds_shift s0 f) = (\<lambda>n. fds_nth f n * nat_power n s0)
[PROOF STEP]
by (auto simp: fun_eq_iff)
[PROOF STATE]
proof (state)
this:
fds_nth (fds_shift s0 f) = (\<lambda>n. fds_nth f n * nat_power n s0)

goal (1 subgoal):
 1. fds_abs_converges f s
[PROOF STEP]
with assms
[PROOF STATE]
proof (chain)
picking this:
Bseq (\<lambda>n. fds_nth f n * nat_power n s0)
1 - s0 \<bullet> (1::'a) < s \<bullet> (1::'a)
fds_nth (fds_shift s0 f) = (\<lambda>n. fds_nth f n * nat_power n s0)
[PROOF STEP]
have "Bseq (fds_nth (fds_shift s0 f))"
[PROOF STATE]
proof (prove)
using this:
Bseq (\<lambda>n. fds_nth f n * nat_power n s0)
1 - s0 \<bullet> (1::'a) < s \<bullet> (1::'a)
fds_nth (fds_shift s0 f) = (\<lambda>n. fds_nth f n * nat_power n s0)

goal (1 subgoal):
 1. Bseq (fds_nth (fds_shift s0 f))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
Bseq (fds_nth (fds_shift s0 f))

goal (1 subgoal):
 1. fds_abs_converges f s
[PROOF STEP]
with assms(2)
[PROOF STATE]
proof (chain)
picking this:
1 - s0 \<bullet> (1::'a) < s \<bullet> (1::'a)
Bseq (fds_nth (fds_shift s0 f))
[PROOF STEP]
have "fds_abs_converges (fds_shift s0 f) (s + s0)"
[PROOF STATE]
proof (prove)
using this:
1 - s0 \<bullet> (1::'a) < s \<bullet> (1::'a)
Bseq (fds_nth (fds_shift s0 f))

goal (1 subgoal):
 1. fds_abs_converges (fds_shift s0 f) (s + s0)
[PROOF STEP]
by (intro bounded_coeffs_imp_fds_abs_converges) (auto simp: algebra_simps)
[PROOF STATE]
proof (state)
this:
fds_abs_converges (fds_shift s0 f) (s + s0)

goal (1 subgoal):
 1. fds_abs_converges f s
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
fds_abs_converges (fds_shift s0 f) (s + s0)

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma butterfly_add_left: \<open>butterfly (a + a') b = butterfly a b + butterfly a' b\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. butterfly (a + a') b = butterfly a b + butterfly a' b
[PROOF STEP]
by (simp add: butterfly_def vector_to_cblinfun_add cbilinear_add_left bounded_cbilinear.add_left bounded_cbilinear_cblinfun_compose)


[STATEMENT]
lemma rel_generat_inf:
  "inf (rel_generat A B C) (rel_generat A' B' C') = rel_generat (inf A A') (inf B B') (inf C C')"
  (is "?lhs = ?rhs")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rel_generat A B C \<sqinter> rel_generat A' B' C' = rel_generat (A \<sqinter> A') (B \<sqinter> B') (C \<sqinter> C')
[PROOF STEP]
proof(rule antisym)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. rel_generat A B C \<sqinter> rel_generat A' B' C' \<le> rel_generat (A \<sqinter> A') (B \<sqinter> B') (C \<sqinter> C')
 2. rel_generat (A \<sqinter> A') (B \<sqinter> B') (C \<sqinter> C') \<le> rel_generat A B C \<sqinter> rel_generat A' B' C'
[PROOF STEP]
show "?lhs \<le> ?rhs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rel_generat A B C \<sqinter> rel_generat A' B' C' \<le> rel_generat (A \<sqinter> A') (B \<sqinter> B') (C \<sqinter> C')
[PROOF STEP]
by(auto elim!: generat.rel_cases simp add: rel_fun_def)
[PROOF STATE]
proof (state)
this:
rel_generat A B C \<sqinter> rel_generat A' B' C' \<le> rel_generat (A \<sqinter> A') (B \<sqinter> B') (C \<sqinter> C')

goal (1 subgoal):
 1. rel_generat (A \<sqinter> A') (B \<sqinter> B') (C \<sqinter> C') \<le> rel_generat A B C \<sqinter> rel_generat A' B' C'
[PROOF STEP]
qed(auto elim: rel_generat_mono)


[STATEMENT]
lemma card_bit[simp]: "CARD(bit) = 2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. CARD(bit) = 2
[PROOF STEP]
using card_2_iff'
[PROOF STATE]
proof (prove)
using this:
(card ?S = 2) = (\<exists>x\<in>?S. \<exists>y\<in>?S. x \<noteq> y \<and> (\<forall>z\<in>?S. z = x \<or> z = y))

goal (1 subgoal):
 1. CARD(bit) = 2
[PROOF STEP]
by force


[STATEMENT]
lemma problem_plan_bound_works:
  fixes PROB :: "'a problem" and as and s :: "'a state"
  assumes "finite PROB" "(s \<in> valid_states PROB)" "(as \<in> valid_plans PROB)"
  shows "(\<exists>as'.
      (exec_plan s as = exec_plan s as')
      \<and> (subseq as' as)
      \<and> (length as' \<le> problem_plan_bound PROB)
    )"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>as'. exec_plan s as = exec_plan s as' \<and> subseq as' as \<and> length as' \<le> problem_plan_bound PROB
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>as'. exec_plan s as = exec_plan s as' \<and> subseq as' as \<and> length as' \<le> problem_plan_bound PROB
[PROOF STEP]
have "problem_plan_bound PROB \<le> 2 ^ card (prob_dom PROB) - 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. problem_plan_bound PROB \<le> 2 ^ card (prob_dom PROB) - 1
[PROOF STEP]
using assms(1) bound_main_lemma
[PROOF STATE]
proof (prove)
using this:
finite PROB
finite ?PROB \<Longrightarrow> problem_plan_bound ?PROB \<le> 2 ^ card (prob_dom ?PROB) - 1

goal (1 subgoal):
 1. problem_plan_bound PROB \<le> 2 ^ card (prob_dom PROB) - 1
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
problem_plan_bound PROB \<le> 2 ^ card (prob_dom PROB) - 1

goal (1 subgoal):
 1. \<exists>as'. exec_plan s as = exec_plan s as' \<and> subseq as' as \<and> length as' \<le> problem_plan_bound PROB
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
problem_plan_bound PROB \<le> 2 ^ card (prob_dom PROB) - 1
[PROOF STEP]
have 1: "Inf (PLS s as) \<le> problem_plan_bound PROB"
[PROOF STATE]
proof (prove)
using this:
problem_plan_bound PROB \<le> 2 ^ card (prob_dom PROB) - 1

goal (1 subgoal):
 1. Inf (PLS s as) \<le> problem_plan_bound PROB
[PROOF STEP]
using
      assms(1, 2, 3)
      problem_plan_bound_ge_min_pls
[PROOF STATE]
proof (prove)
using this:
problem_plan_bound PROB \<le> 2 ^ card (prob_dom PROB) - 1
finite PROB
s \<in> valid_states PROB
as \<in> valid_plans PROB
\<lbrakk>finite ?PROB; ?s \<in> valid_states ?PROB; ?as \<in> valid_plans ?PROB; problem_plan_bound ?PROB \<le> ?k\<rbrakk> \<Longrightarrow> Inf (PLS ?s ?as) \<le> problem_plan_bound ?PROB

goal (1 subgoal):
 1. Inf (PLS s as) \<le> problem_plan_bound PROB
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
Inf (PLS s as) \<le> problem_plan_bound PROB

goal (1 subgoal):
 1. \<exists>as'. exec_plan s as = exec_plan s as' \<and> subseq as' as \<and> length as' \<le> problem_plan_bound PROB
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
Inf (PLS s as) \<le> problem_plan_bound PROB
[PROOF STEP]
have "\<exists>x. x \<in> PLS s as \<and> x = Inf (PLS s as)"
[PROOF STATE]
proof (prove)
using this:
Inf (PLS s as) \<le> problem_plan_bound PROB

goal (1 subgoal):
 1. \<exists>x. x \<in> PLS s as \<and> x = Inf (PLS s as)
[PROOF STEP]
using PLS_nempty_and_has_min
[PROOF STATE]
proof (prove)
using this:
Inf (PLS s as) \<le> problem_plan_bound PROB
\<exists>x. x \<in> PLS ?s ?as \<and> x = Inf (PLS ?s ?as)

goal (1 subgoal):
 1. \<exists>x. x \<in> PLS s as \<and> x = Inf (PLS s as)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<exists>x. x \<in> PLS s as \<and> x = Inf (PLS s as)

goal (1 subgoal):
 1. \<exists>as'. exec_plan s as = exec_plan s as' \<and> subseq as' as \<and> length as' \<le> problem_plan_bound PROB
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>x. x \<in> PLS s as \<and> x = Inf (PLS s as)
[PROOF STEP]
have "Inf (PLS s as) \<in> (PLS s as)"
[PROOF STATE]
proof (prove)
using this:
\<exists>x. x \<in> PLS s as \<and> x = Inf (PLS s as)

goal (1 subgoal):
 1. Inf (PLS s as) \<in> PLS s as
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
Inf (PLS s as) \<in> PLS s as

goal (1 subgoal):
 1. \<exists>as'. exec_plan s as = exec_plan s as' \<and> subseq as' as \<and> length as' \<le> problem_plan_bound PROB
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
Inf (PLS s as) \<in> PLS s as
[PROOF STEP]
obtain as' where 2:
    "exec_plan s as = exec_plan s as'" "length as' = Inf (PLS s as)" "subseq as' as"
[PROOF STATE]
proof (prove)
using this:
Inf (PLS s as) \<in> PLS s as

goal (1 subgoal):
 1. (\<And>as'. \<lbrakk>exec_plan s as = exec_plan s as'; length as' = Inf (PLS s as); subseq as' as\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using PLS_works
[PROOF STATE]
proof (prove)
using this:
Inf (PLS s as) \<in> PLS s as
?x \<in> PLS ?s ?as \<Longrightarrow> \<exists>as'. exec_plan ?s ?as = exec_plan ?s as' \<and> length as' = ?x \<and> subseq as' ?as

goal (1 subgoal):
 1. (\<And>as'. \<lbrakk>exec_plan s as = exec_plan s as'; length as' = Inf (PLS s as); subseq as' as\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
exec_plan s as = exec_plan s as'
length as' = Inf (PLS s as)
subseq as' as

goal (1 subgoal):
 1. \<exists>as'. exec_plan s as = exec_plan s as' \<and> subseq as' as \<and> length as' \<le> problem_plan_bound PROB
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
exec_plan s as = exec_plan s as'
length as' = Inf (PLS s as)
subseq as' as
[PROOF STEP]
have "length as' \<le> problem_plan_bound PROB"
[PROOF STATE]
proof (prove)
using this:
exec_plan s as = exec_plan s as'
length as' = Inf (PLS s as)
subseq as' as

goal (1 subgoal):
 1. length as' \<le> problem_plan_bound PROB
[PROOF STEP]
using 1
[PROOF STATE]
proof (prove)
using this:
exec_plan s as = exec_plan s as'
length as' = Inf (PLS s as)
subseq as' as
Inf (PLS s as) \<le> problem_plan_bound PROB

goal (1 subgoal):
 1. length as' \<le> problem_plan_bound PROB
[PROOF STEP]
by argo
[PROOF STATE]
proof (state)
this:
length as' \<le> problem_plan_bound PROB

goal (1 subgoal):
 1. \<exists>as'. exec_plan s as = exec_plan s as' \<and> subseq as' as \<and> length as' \<le> problem_plan_bound PROB
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
length as' \<le> problem_plan_bound PROB
[PROOF STEP]
show "(\<exists>as'.
    (exec_plan s as = exec_plan s as')
    \<and> (subseq as' as)
    \<and> (length as' \<le> problem_plan_bound PROB)
  )"
[PROOF STATE]
proof (prove)
using this:
length as' \<le> problem_plan_bound PROB

goal (1 subgoal):
 1. \<exists>as'. exec_plan s as = exec_plan s as' \<and> subseq as' as \<and> length as' \<le> problem_plan_bound PROB
[PROOF STEP]
using 2(1) 2(3)
[PROOF STATE]
proof (prove)
using this:
length as' \<le> problem_plan_bound PROB
exec_plan s as = exec_plan s as'
subseq as' as

goal (1 subgoal):
 1. \<exists>as'. exec_plan s as = exec_plan s as' \<and> subseq as' as \<and> length as' \<le> problem_plan_bound PROB
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<exists>as'. exec_plan s as = exec_plan s as' \<and> subseq as' as \<and> length as' \<le> problem_plan_bound PROB

goal:
No subgoals!
[PROOF STEP]
qed

\<comment> \<open>NOTE name shortened.\<close>


[STATEMENT]
lemma not_sub_single:"\<lbrakk>A \<noteq> {}; A \<noteq> {a}\<rbrakk> \<Longrightarrow> \<not> A \<subseteq> {a}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>A \<noteq> {}; A \<noteq> {a}\<rbrakk> \<Longrightarrow> \<not> A \<subseteq> {a}
[PROOF STEP]
by blast


[STATEMENT]
lemma edge_pred_succ[simp]: "edge_pred M (edge_succ M a) = a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. edge_pred M (edge_succ M a) = a
[PROOF STEP]
by (metis edge_pred_def edge_succ_permutes permutes_inverses(2))


[STATEMENT]
lemma continuous_within_sin: "continuous (at z within s) sin"
  for z :: "'a::{real_normed_field,banach}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous (at z within s) sin
[PROOF STEP]
by (simp add: continuous_within tendsto_sin)


[STATEMENT]
lemma (in vectorspace) dim_subadditive:
assumes "subspace K W1 V"
and "vectorspace.fin_dim K (vs W1)"
assumes "subspace K W2 V"
and "vectorspace.fin_dim K (vs W2)"
shows "vectorspace.dim K (vs (subspace_sum W1 W2)) \<le> vectorspace.dim K (vs W1) + vectorspace.dim K (vs W2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vectorspace.dim K (vs (subspace_sum W1 W2)) \<le> vectorspace.dim K (vs W1) + vectorspace.dim K (vs W2)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. vectorspace.dim K (vs (subspace_sum W1 W2)) \<le> vectorspace.dim K (vs W1) + vectorspace.dim K (vs W2)
[PROOF STEP]
have "vectorspace K (vs W1)" "vectorspace K (vs W2)" "submodule K W1 V" "submodule K W2 V"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (vectorspace K (vs W1) &&& vectorspace K (vs W2)) &&& LinearCombinations.submodule K W1 V &&& LinearCombinations.submodule K W2 V
[PROOF STEP]
by (simp add: \<open>subspace K W1 V\<close> \<open>subspace K W2 V\<close> subspace_is_vs)+
[PROOF STATE]
proof (state)
this:
vectorspace K (vs W1)
vectorspace K (vs W2)
LinearCombinations.submodule K W1 V
LinearCombinations.submodule K W2 V

goal (1 subgoal):
 1. vectorspace.dim K (vs (subspace_sum W1 W2)) \<le> vectorspace.dim K (vs W1) + vectorspace.dim K (vs W2)
[PROOF STEP]
obtain b1 b2 where "vectorspace.basis K (vs W1) b1" "vectorspace.basis K (vs W2) b2" "finite b1" "finite b2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>b1 b2. \<lbrakk>vectorspace.basis K (vs W1) b1; vectorspace.basis K (vs W2) b2; finite b1; finite b2\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using vectorspace.finite_basis_exists[OF \<open>vectorspace K (vs W1)\<close> \<open>vectorspace.fin_dim K (vs W1)\<close>]
[PROOF STATE]
proof (prove)
using this:
\<exists>\<beta>. finite \<beta> \<and> vectorspace.basis K (vs W1) \<beta>

goal (1 subgoal):
 1. (\<And>b1 b2. \<lbrakk>vectorspace.basis K (vs W1) b1; vectorspace.basis K (vs W2) b2; finite b1; finite b2\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using vectorspace.finite_basis_exists[OF \<open>vectorspace K (vs W2)\<close> \<open>vectorspace.fin_dim K (vs W2)\<close>]
[PROOF STATE]
proof (prove)
using this:
\<exists>\<beta>. finite \<beta> \<and> vectorspace.basis K (vs W1) \<beta>
\<exists>\<beta>. finite \<beta> \<and> vectorspace.basis K (vs W2) \<beta>

goal (1 subgoal):
 1. (\<And>b1 b2. \<lbrakk>vectorspace.basis K (vs W1) b1; vectorspace.basis K (vs W2) b2; finite b1; finite b2\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
vectorspace.basis K (vs W1) b1
vectorspace.basis K (vs W2) b2
finite b1
finite b2

goal (1 subgoal):
 1. vectorspace.dim K (vs (subspace_sum W1 W2)) \<le> vectorspace.dim K (vs W1) + vectorspace.dim K (vs W2)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
vectorspace.basis K (vs W1) b1
vectorspace.basis K (vs W2) b2
finite b1
finite b2
[PROOF STEP]
have "LinearCombinations.module.gen_set K (vs W1) b1" "LinearCombinations.module.gen_set K (vs W2) b2"
[PROOF STATE]
proof (prove)
using this:
vectorspace.basis K (vs W1) b1
vectorspace.basis K (vs W2) b2
finite b1
finite b2

goal (1 subgoal):
 1. LinearCombinations.module.span K (vs W1) b1 = carrier (vs W1) &&& LinearCombinations.module.span K (vs W2) b2 = carrier (vs W2)
[PROOF STEP]
using \<open>vectorspace K (vs W1)\<close> \<open>vectorspace K (vs W2)\<close> vectorspace.basis_def
[PROOF STATE]
proof (prove)
using this:
vectorspace.basis K (vs W1) b1
vectorspace.basis K (vs W2) b2
finite b1
finite b2
vectorspace K (vs W1)
vectorspace K (vs W2)
vectorspace ?K ?V \<Longrightarrow> vectorspace.basis ?K ?V ?A = (\<not> LinearCombinations.module.lin_dep ?K ?V ?A \<and> LinearCombinations.module.span ?K ?V ?A = carrier ?V \<and> ?A \<subseteq> carrier ?V)

goal (1 subgoal):
 1. LinearCombinations.module.span K (vs W1) b1 = carrier (vs W1) &&& LinearCombinations.module.span K (vs W2) b2 = carrier (vs W2)
[PROOF STEP]
by blast+
[PROOF STATE]
proof (state)
this:
LinearCombinations.module.span K (vs W1) b1 = carrier (vs W1)
LinearCombinations.module.span K (vs W2) b2 = carrier (vs W2)

goal (1 subgoal):
 1. vectorspace.dim K (vs (subspace_sum W1 W2)) \<le> vectorspace.dim K (vs W1) + vectorspace.dim K (vs W2)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
LinearCombinations.module.span K (vs W1) b1 = carrier (vs W1)
LinearCombinations.module.span K (vs W2) b2 = carrier (vs W2)
[PROOF STEP]
have "span b1 = W1" "span b2 = W2"
[PROOF STATE]
proof (prove)
using this:
LinearCombinations.module.span K (vs W1) b1 = carrier (vs W1)
LinearCombinations.module.span K (vs W2) b2 = carrier (vs W2)

goal (1 subgoal):
 1. local.module.span b1 = W1 &&& local.module.span b2 = W2
[PROOF STEP]
using module.span_li_not_depend(1) \<open>submodule K W1 V\<close>  \<open>submodule K W2 V\<close>
    \<open>vectorspace K (vs W1)\<close> \<open>vectorspace.basis K (vs W1) b1\<close> \<open>vectorspace K (vs W2)\<close>
    \<open>vectorspace.basis K (vs W2) b2\<close> vectorspace.basis_def
[PROOF STATE]
proof (prove)
using this:
LinearCombinations.module.span K (vs W1) b1 = carrier (vs W1)
LinearCombinations.module.span K (vs W2) b2 = carrier (vs W2)
\<lbrakk>?S \<subseteq> ?N; LinearCombinations.submodule K ?N V\<rbrakk> \<Longrightarrow> LinearCombinations.module.span K (vs ?N) ?S = local.module.span ?S
LinearCombinations.submodule K W1 V
LinearCombinations.submodule K W2 V
vectorspace K (vs W1)
vectorspace.basis K (vs W1) b1
vectorspace K (vs W2)
vectorspace.basis K (vs W2) b2
vectorspace ?K ?V \<Longrightarrow> vectorspace.basis ?K ?V ?A = (\<not> LinearCombinations.module.lin_dep ?K ?V ?A \<and> LinearCombinations.module.span ?K ?V ?A = carrier ?V \<and> ?A \<subseteq> carrier ?V)

goal (1 subgoal):
 1. local.module.span b1 = W1 &&& local.module.span b2 = W2
[PROOF STEP]
by force+
[PROOF STATE]
proof (state)
this:
local.module.span b1 = W1
local.module.span b2 = W2

goal (1 subgoal):
 1. vectorspace.dim K (vs (subspace_sum W1 W2)) \<le> vectorspace.dim K (vs W1) + vectorspace.dim K (vs W2)
[PROOF STEP]
have "W1 \<subseteq> carrier V" "W2 \<subseteq> carrier V"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. W1 \<subseteq> carrier V &&& W2 \<subseteq> carrier V
[PROOF STEP]
using \<open>subspace K W1 V\<close> \<open>subspace K W2 V\<close> subspace_def submodule_def
[PROOF STATE]
proof (prove)
using this:
subspace K W1 V
subspace K W2 V
subspace ?K ?W ?V \<equiv> vectorspace ?K ?V \<and> LinearCombinations.submodule ?K ?W ?V
LinearCombinations.submodule ?R ?N ?M \<equiv> (module ?R ?M \<and> ?N \<subseteq> carrier ?M) \<and> (\<forall>v w. v \<in> ?N \<longrightarrow> w \<in> ?N \<longrightarrow> v \<oplus>\<^bsub>?M\<^esub> w \<in> ?N) \<and> \<zero>\<^bsub>?M\<^esub> \<in> ?N \<and> (\<forall>c v. c \<in> carrier ?R \<longrightarrow> v \<in> ?N \<longrightarrow> c \<odot>\<^bsub>?M\<^esub> v \<in> ?N)

goal (1 subgoal):
 1. W1 \<subseteq> carrier V &&& W2 \<subseteq> carrier V
[PROOF STEP]
by metis+
[PROOF STATE]
proof (state)
this:
W1 \<subseteq> carrier V
W2 \<subseteq> carrier V

goal (1 subgoal):
 1. vectorspace.dim K (vs (subspace_sum W1 W2)) \<le> vectorspace.dim K (vs W1) + vectorspace.dim K (vs W2)
[PROOF STEP]
have "b1 \<subseteq> carrier V"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. b1 \<subseteq> carrier V
[PROOF STEP]
using \<open>vectorspace.basis K (vs W1) b1\<close> \<open>vectorspace K (vs W1)\<close> vectorspace.basis_def
    \<open>W1 \<subseteq> carrier V\<close>
[PROOF STATE]
proof (prove)
using this:
vectorspace.basis K (vs W1) b1
vectorspace K (vs W1)
vectorspace ?K ?V \<Longrightarrow> vectorspace.basis ?K ?V ?A = (\<not> LinearCombinations.module.lin_dep ?K ?V ?A \<and> LinearCombinations.module.span ?K ?V ?A = carrier ?V \<and> ?A \<subseteq> carrier ?V)
W1 \<subseteq> carrier V

goal (1 subgoal):
 1. b1 \<subseteq> carrier V
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
b1 \<subseteq> carrier V

goal (1 subgoal):
 1. vectorspace.dim K (vs (subspace_sum W1 W2)) \<le> vectorspace.dim K (vs W1) + vectorspace.dim K (vs W2)
[PROOF STEP]
have "b2 \<subseteq> carrier V"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. b2 \<subseteq> carrier V
[PROOF STEP]
using \<open>vectorspace.basis K (vs W2) b2\<close> \<open>vectorspace K (vs W2)\<close> vectorspace.basis_def
    \<open>W2 \<subseteq> carrier V\<close>
[PROOF STATE]
proof (prove)
using this:
vectorspace.basis K (vs W2) b2
vectorspace K (vs W2)
vectorspace ?K ?V \<Longrightarrow> vectorspace.basis ?K ?V ?A = (\<not> LinearCombinations.module.lin_dep ?K ?V ?A \<and> LinearCombinations.module.span ?K ?V ?A = carrier ?V \<and> ?A \<subseteq> carrier ?V)
W2 \<subseteq> carrier V

goal (1 subgoal):
 1. b2 \<subseteq> carrier V
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
b2 \<subseteq> carrier V

goal (1 subgoal):
 1. vectorspace.dim K (vs (subspace_sum W1 W2)) \<le> vectorspace.dim K (vs W1) + vectorspace.dim K (vs W2)
[PROOF STEP]
have "finite (b1 \<union> b2)" "b1 \<union> b2 \<subseteq> carrier V"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (b1 \<union> b2) &&& b1 \<union> b2 \<subseteq> carrier V
[PROOF STEP]
by (simp_all add: \<open>finite b1\<close> \<open>finite b2\<close> \<open>b2 \<subseteq> carrier V\<close> \<open>b1 \<subseteq> carrier V\<close>)
[PROOF STATE]
proof (state)
this:
finite (b1 \<union> b2)
b1 \<union> b2 \<subseteq> carrier V

goal (1 subgoal):
 1. vectorspace.dim K (vs (subspace_sum W1 W2)) \<le> vectorspace.dim K (vs W1) + vectorspace.dim K (vs W2)
[PROOF STEP]
have "subspace_sum W1 W2 \<subseteq> span (b1\<union>b2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. subspace_sum W1 W2 \<subseteq> local.module.span (b1 \<union> b2)
[PROOF STEP]
proof (rule subsetI)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> subspace_sum W1 W2 \<Longrightarrow> x \<in> local.module.span (b1 \<union> b2)
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> subspace_sum W1 W2 \<Longrightarrow> x \<in> local.module.span (b1 \<union> b2)
[PROOF STEP]
assume "x \<in> subspace_sum W1 W2"
[PROOF STATE]
proof (state)
this:
x \<in> subspace_sum W1 W2

goal (1 subgoal):
 1. \<And>x. x \<in> subspace_sum W1 W2 \<Longrightarrow> x \<in> local.module.span (b1 \<union> b2)
[PROOF STEP]
obtain x1 x2 where  "x1 \<in> W1" "x2 \<in> W2" "x = x1 \<oplus>\<^bsub>V\<^esub> x2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>x1 x2. \<lbrakk>x1 \<in> W1; x2 \<in> W2; x = x1 \<oplus>\<^bsub>V\<^esub> x2\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using imageE[OF \<open>x \<in> subspace_sum W1 W2\<close>[unfolded submodule_sum_def]]
[PROOF STATE]
proof (prove)
using this:
(\<And>xa. \<lbrakk>x = (case xa of (x, xa) \<Rightarrow> x \<oplus>\<^bsub>V\<^esub> xa); xa \<in> {(x, y). x \<in> W1 \<and> y \<in> W2}\<rbrakk> \<Longrightarrow> ?thesis) \<Longrightarrow> ?thesis

goal (1 subgoal):
 1. (\<And>x1 x2. \<lbrakk>x1 \<in> W1; x2 \<in> W2; x = x1 \<oplus>\<^bsub>V\<^esub> x2\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (metis (no_types, lifting) BNF_Def.Collect_case_prodD split_def)
[PROOF STATE]
proof (state)
this:
x1 \<in> W1
x2 \<in> W2
x = x1 \<oplus>\<^bsub>V\<^esub> x2

goal (1 subgoal):
 1. \<And>x. x \<in> subspace_sum W1 W2 \<Longrightarrow> x \<in> local.module.span (b1 \<union> b2)
[PROOF STEP]
obtain a1 where "x1 = lincomb a1 b1" "a1\<in> (b1\<rightarrow>carrier K)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>a1. \<lbrakk>x1 = lincomb a1 b1; a1 \<in> b1 \<rightarrow> carrier K\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using \<open>span b1 = W1\<close> finite_span[OF \<open>finite b1\<close> \<open>b1 \<subseteq> carrier V\<close>] \<open>x1 \<in> W1\<close>
[PROOF STATE]
proof (prove)
using this:
local.module.span b1 = W1
local.module.span b1 = {lincomb a b1 |a. a \<in> b1 \<rightarrow> carrier K}
x1 \<in> W1

goal (1 subgoal):
 1. (\<And>a1. \<lbrakk>x1 = lincomb a1 b1; a1 \<in> b1 \<rightarrow> carrier K\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
x1 = lincomb a1 b1
a1 \<in> b1 \<rightarrow> carrier K

goal (1 subgoal):
 1. \<And>x. x \<in> subspace_sum W1 W2 \<Longrightarrow> x \<in> local.module.span (b1 \<union> b2)
[PROOF STEP]
obtain a2 where "x2 = lincomb a2 b2" "a2\<in> (b2\<rightarrow>carrier K)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>a2. \<lbrakk>x2 = lincomb a2 b2; a2 \<in> b2 \<rightarrow> carrier K\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using \<open>span b2 = W2\<close> finite_span[OF \<open>finite b2\<close> \<open>b2 \<subseteq> carrier V\<close>] \<open>x2 \<in> W2\<close>
[PROOF STATE]
proof (prove)
using this:
local.module.span b2 = W2
local.module.span b2 = {lincomb a b2 |a. a \<in> b2 \<rightarrow> carrier K}
x2 \<in> W2

goal (1 subgoal):
 1. (\<And>a2. \<lbrakk>x2 = lincomb a2 b2; a2 \<in> b2 \<rightarrow> carrier K\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
x2 = lincomb a2 b2
a2 \<in> b2 \<rightarrow> carrier K

goal (1 subgoal):
 1. \<And>x. x \<in> subspace_sum W1 W2 \<Longrightarrow> x \<in> local.module.span (b1 \<union> b2)
[PROOF STEP]
obtain a where "x = lincomb a (b1 \<union> b2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>a. x = lincomb a (b1 \<union> b2) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using lincomb_add[OF \<open>finite (b1 \<union> b2)\<close> \<open>b1 \<union> b2 \<subseteq> carrier V\<close>
      \<open>x1 = lincomb a1 b1\<close> \<open>a1\<in> (b1\<rightarrow>carrier K)\<close>  \<open>x2 = lincomb a2 b2\<close> \<open>a2\<in> (b2\<rightarrow>carrier K)\<close> \<open>x = x1 \<oplus>\<^bsub>V\<^esub> x2\<close>]
[PROOF STATE]
proof (prove)
using this:
lincomb (\<lambda>v. (if v \<in> b1 then a1 v else \<zero>\<^bsub>K\<^esub>) \<oplus>\<^bsub>K\<^esub> (if v \<in> b2 then a2 v else \<zero>\<^bsub>K\<^esub>)) (b1 \<union> b2) = x

goal (1 subgoal):
 1. (\<And>a. x = lincomb a (b1 \<union> b2) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
x = lincomb a (b1 \<union> b2)

goal (1 subgoal):
 1. \<And>x. x \<in> subspace_sum W1 W2 \<Longrightarrow> x \<in> local.module.span (b1 \<union> b2)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x = lincomb a (b1 \<union> b2)
[PROOF STEP]
show "x \<in> span (b1 \<union> b2)"
[PROOF STATE]
proof (prove)
using this:
x = lincomb a (b1 \<union> b2)

goal (1 subgoal):
 1. x \<in> local.module.span (b1 \<union> b2)
[PROOF STEP]
using finite_span[OF \<open>finite (b1 \<union> b2)\<close> \<open>(b1 \<union> b2) \<subseteq> carrier V\<close>]
[PROOF STATE]
proof (prove)
using this:
x = lincomb a (b1 \<union> b2)
local.module.span (b1 \<union> b2) = {lincomb a (b1 \<union> b2) |a. a \<in> b1 \<union> b2 \<rightarrow> carrier K}

goal (1 subgoal):
 1. x \<in> local.module.span (b1 \<union> b2)
[PROOF STEP]
using \<open>b1 \<subseteq> carrier V\<close> \<open>b2 \<subseteq> carrier V\<close> \<open>span b1 = W1\<close> \<open>span b2 = W2\<close> \<open>x \<in> subspace_sum W1 W2\<close> span_union_is_sum
[PROOF STATE]
proof (prove)
using this:
x = lincomb a (b1 \<union> b2)
local.module.span (b1 \<union> b2) = {lincomb a (b1 \<union> b2) |a. a \<in> b1 \<union> b2 \<rightarrow> carrier K}
b1 \<subseteq> carrier V
b2 \<subseteq> carrier V
local.module.span b1 = W1
local.module.span b2 = W2
x \<in> subspace_sum W1 W2
\<lbrakk>?A \<subseteq> carrier V; ?B \<subseteq> carrier V\<rbrakk> \<Longrightarrow> local.module.span (?A \<union> ?B) = subspace_sum (local.module.span ?A) (local.module.span ?B)

goal (1 subgoal):
 1. x \<in> local.module.span (b1 \<union> b2)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
x \<in> local.module.span (b1 \<union> b2)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
subspace_sum W1 W2 \<subseteq> local.module.span (b1 \<union> b2)

goal (1 subgoal):
 1. vectorspace.dim K (vs (subspace_sum W1 W2)) \<le> vectorspace.dim K (vs W1) + vectorspace.dim K (vs W2)
[PROOF STEP]
have "b1 \<subseteq> W1" "b2 \<subseteq> W2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. b1 \<subseteq> W1 &&& b2 \<subseteq> W2
[PROOF STEP]
using \<open>vectorspace K (vs W1)\<close> \<open>vectorspace K (vs W2)\<close> \<open>vectorspace.basis K (vs W1) b1\<close>
    \<open>vectorspace.basis K (vs W2) b2\<close> vectorspace.basis_def local.carrier_vs_is_self
[PROOF STATE]
proof (prove)
using this:
vectorspace K (vs W1)
vectorspace K (vs W2)
vectorspace.basis K (vs W1) b1
vectorspace.basis K (vs W2) b2
vectorspace ?K ?V \<Longrightarrow> vectorspace.basis ?K ?V ?A = (\<not> LinearCombinations.module.lin_dep ?K ?V ?A \<and> LinearCombinations.module.span ?K ?V ?A = carrier ?V \<and> ?A \<subseteq> carrier ?V)
carrier (vs ?W) = ?W

goal (1 subgoal):
 1. b1 \<subseteq> W1 &&& b2 \<subseteq> W2
[PROOF STEP]
by blast+
[PROOF STATE]
proof (state)
this:
b1 \<subseteq> W1
b2 \<subseteq> W2

goal (1 subgoal):
 1. vectorspace.dim K (vs (subspace_sum W1 W2)) \<le> vectorspace.dim K (vs W1) + vectorspace.dim K (vs W2)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
b1 \<subseteq> W1
b2 \<subseteq> W2
[PROOF STEP]
have "b1\<union>b2 \<subseteq> subspace_sum W1 W2"
[PROOF STATE]
proof (prove)
using this:
b1 \<subseteq> W1
b2 \<subseteq> W2

goal (1 subgoal):
 1. b1 \<union> b2 \<subseteq> subspace_sum W1 W2
[PROOF STEP]
using \<open>submodule K W1 V\<close> \<open>submodule K W2 V\<close> in_sum
[PROOF STATE]
proof (prove)
using this:
b1 \<subseteq> W1
b2 \<subseteq> W2
LinearCombinations.submodule K W1 V
LinearCombinations.submodule K W2 V
\<lbrakk>LinearCombinations.submodule K ?N1.0 V; LinearCombinations.submodule K ?N2.0 V\<rbrakk> \<Longrightarrow> ?N1.0 \<subseteq> subspace_sum ?N1.0 ?N2.0

goal (1 subgoal):
 1. b1 \<union> b2 \<subseteq> subspace_sum W1 W2
[PROOF STEP]
by (metis assms(1) assms(3) dual_order.trans sup_least vectorspace.vsum_comm vectorspace_axioms)
[PROOF STATE]
proof (state)
this:
b1 \<union> b2 \<subseteq> subspace_sum W1 W2

goal (1 subgoal):
 1. vectorspace.dim K (vs (subspace_sum W1 W2)) \<le> vectorspace.dim K (vs W1) + vectorspace.dim K (vs W2)
[PROOF STEP]
have "subspace_sum W1 W2 = LinearCombinations.module.span K (vs (subspace_sum W1 W2)) (b1\<union>b2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. subspace_sum W1 W2 = LinearCombinations.module.span K (vs (subspace_sum W1 W2)) (b1 \<union> b2)
[PROOF STEP]
proof (rule subset_antisym)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. subspace_sum W1 W2 \<subseteq> LinearCombinations.module.span K (vs (subspace_sum W1 W2)) (b1 \<union> b2)
 2. LinearCombinations.module.span K (vs (subspace_sum W1 W2)) (b1 \<union> b2) \<subseteq> subspace_sum W1 W2
[PROOF STEP]
have "submodule K (subspace_sum W1 W2) V"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. LinearCombinations.submodule K (subspace_sum W1 W2) V
[PROOF STEP]
by (simp add: \<open>submodule K W1 V\<close> \<open>submodule K W2 V\<close> sum_is_submodule)
[PROOF STATE]
proof (state)
this:
LinearCombinations.submodule K (subspace_sum W1 W2) V

goal (2 subgoals):
 1. subspace_sum W1 W2 \<subseteq> LinearCombinations.module.span K (vs (subspace_sum W1 W2)) (b1 \<union> b2)
 2. LinearCombinations.module.span K (vs (subspace_sum W1 W2)) (b1 \<union> b2) \<subseteq> subspace_sum W1 W2
[PROOF STEP]
show "subspace_sum W1 W2 \<subseteq> LinearCombinations.module.span K (vs (subspace_sum W1 W2)) (b1\<union>b2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. subspace_sum W1 W2 \<subseteq> LinearCombinations.module.span K (vs (subspace_sum W1 W2)) (b1 \<union> b2)
[PROOF STEP]
using module.span_li_not_depend(1)[OF \<open>b1\<union>b2 \<subseteq> subspace_sum W1 W2\<close> \<open>submodule K (subspace_sum W1 W2) V\<close>]
[PROOF STATE]
proof (prove)
using this:
LinearCombinations.module.span K (vs (subspace_sum W1 W2)) (b1 \<union> b2) = local.module.span (b1 \<union> b2)

goal (1 subgoal):
 1. subspace_sum W1 W2 \<subseteq> LinearCombinations.module.span K (vs (subspace_sum W1 W2)) (b1 \<union> b2)
[PROOF STEP]
by (simp add: \<open>subspace_sum W1 W2 \<subseteq> span (b1 \<union> b2)\<close>)
[PROOF STATE]
proof (state)
this:
subspace_sum W1 W2 \<subseteq> LinearCombinations.module.span K (vs (subspace_sum W1 W2)) (b1 \<union> b2)

goal (1 subgoal):
 1. LinearCombinations.module.span K (vs (subspace_sum W1 W2)) (b1 \<union> b2) \<subseteq> subspace_sum W1 W2
[PROOF STEP]
show "subspace_sum W1 W2 \<supseteq> LinearCombinations.module.span K (vs (subspace_sum W1 W2)) (b1\<union>b2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. LinearCombinations.module.span K (vs (subspace_sum W1 W2)) (b1 \<union> b2) \<subseteq> subspace_sum W1 W2
[PROOF STEP]
using \<open>b1\<union>b2 \<subseteq> subspace_sum W1 W2\<close>
[PROOF STATE]
proof (prove)
using this:
b1 \<union> b2 \<subseteq> subspace_sum W1 W2

goal (1 subgoal):
 1. LinearCombinations.module.span K (vs (subspace_sum W1 W2)) (b1 \<union> b2) \<subseteq> subspace_sum W1 W2
[PROOF STEP]
by (metis (full_types) LinearCombinations.module.span_is_subset2
      LinearCombinations.module.submodule_is_module \<open>submodule K (subspace_sum W1 W2) V\<close> local.carrier_vs_is_self submodule_def)
[PROOF STATE]
proof (state)
this:
LinearCombinations.module.span K (vs (subspace_sum W1 W2)) (b1 \<union> b2) \<subseteq> subspace_sum W1 W2

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
subspace_sum W1 W2 = LinearCombinations.module.span K (vs (subspace_sum W1 W2)) (b1 \<union> b2)

goal (1 subgoal):
 1. vectorspace.dim K (vs (subspace_sum W1 W2)) \<le> vectorspace.dim K (vs W1) + vectorspace.dim K (vs W2)
[PROOF STEP]
have "vectorspace K (vs (subspace_sum W1 W2))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vectorspace K (vs (subspace_sum W1 W2))
[PROOF STEP]
using assms(1) assms(3) subspace_def sum_is_subspace vectorspace.subspace_is_vs
[PROOF STATE]
proof (prove)
using this:
subspace K W1 V
subspace K W2 V
subspace ?K ?W ?V \<equiv> vectorspace ?K ?V \<and> LinearCombinations.submodule ?K ?W ?V
\<lbrakk>subspace K ?W1.0 V; subspace K ?W2.0 V\<rbrakk> \<Longrightarrow> subspace K (subspace_sum ?W1.0 ?W2.0) V
\<lbrakk>vectorspace ?K ?V; subspace ?K ?W ?V\<rbrakk> \<Longrightarrow> vectorspace ?K (?V\<lparr>carrier := ?W\<rparr>)

goal (1 subgoal):
 1. vectorspace K (vs (subspace_sum W1 W2))
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
vectorspace K (vs (subspace_sum W1 W2))

goal (1 subgoal):
 1. vectorspace.dim K (vs (subspace_sum W1 W2)) \<le> vectorspace.dim K (vs W1) + vectorspace.dim K (vs W2)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
vectorspace K (vs (subspace_sum W1 W2))
[PROOF STEP]
have "vectorspace.dim K (vs (subspace_sum W1 W2)) \<le> card (b1 \<union> b2)"
[PROOF STATE]
proof (prove)
using this:
vectorspace K (vs (subspace_sum W1 W2))

goal (1 subgoal):
 1. vectorspace.dim K (vs (subspace_sum W1 W2)) \<le> card (b1 \<union> b2)
[PROOF STEP]
using vectorspace.gen_ge_dim[OF \<open>vectorspace K (vs (subspace_sum W1 W2))\<close> \<open>finite (b1 \<union> b2)\<close>]
    \<open>b1 \<union> b2 \<subseteq> subspace_sum W1 W2\<close>
    \<open>subspace_sum W1 W2 = LinearCombinations.module.span K (vs (subspace_sum W1 W2)) (b1 \<union> b2)\<close>
    local.carrier_vs_is_self
[PROOF STATE]
proof (prove)
using this:
vectorspace K (vs (subspace_sum W1 W2))
\<lbrakk>b1 \<union> b2 \<subseteq> carrier (vs (subspace_sum W1 W2)); LinearCombinations.module.span K (vs (subspace_sum W1 W2)) (b1 \<union> b2) = carrier (vs (subspace_sum W1 W2))\<rbrakk> \<Longrightarrow> vectorspace.dim K (vs (subspace_sum W1 W2)) \<le> card (b1 \<union> b2)
b1 \<union> b2 \<subseteq> subspace_sum W1 W2
subspace_sum W1 W2 = LinearCombinations.module.span K (vs (subspace_sum W1 W2)) (b1 \<union> b2)
carrier (vs ?W) = ?W

goal (1 subgoal):
 1. vectorspace.dim K (vs (subspace_sum W1 W2)) \<le> card (b1 \<union> b2)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
vectorspace.dim K (vs (subspace_sum W1 W2)) \<le> card (b1 \<union> b2)

goal (1 subgoal):
 1. vectorspace.dim K (vs (subspace_sum W1 W2)) \<le> vectorspace.dim K (vs W1) + vectorspace.dim K (vs W2)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
vectorspace.dim K (vs (subspace_sum W1 W2)) \<le> card (b1 \<union> b2)

goal (1 subgoal):
 1. vectorspace.dim K (vs (subspace_sum W1 W2)) \<le> vectorspace.dim K (vs W1) + vectorspace.dim K (vs W2)
[PROOF STEP]
have "... \<le> card b1 + card b2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card (b1 \<union> b2) \<le> card b1 + card b2
[PROOF STEP]
by (simp add: card_Un_le)
[PROOF STATE]
proof (state)
this:
card (b1 \<union> b2) \<le> card b1 + card b2

goal (1 subgoal):
 1. vectorspace.dim K (vs (subspace_sum W1 W2)) \<le> vectorspace.dim K (vs W1) + vectorspace.dim K (vs W2)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
card (b1 \<union> b2) \<le> card b1 + card b2

goal (1 subgoal):
 1. vectorspace.dim K (vs (subspace_sum W1 W2)) \<le> vectorspace.dim K (vs W1) + vectorspace.dim K (vs W2)
[PROOF STEP]
have "... = vectorspace.dim K (vs W1) + vectorspace.dim K (vs W2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card b1 + card b2 = vectorspace.dim K (vs W1) + vectorspace.dim K (vs W2)
[PROOF STEP]
by (metis \<open>finite b1\<close> \<open>finite b2\<close> \<open>vectorspace K (vs W1)\<close> \<open>vectorspace K (vs W2)\<close>
    \<open>vectorspace.basis K (vs W1) b1\<close> \<open>vectorspace.basis K (vs W2) b2\<close> vectorspace.dim_basis)
[PROOF STATE]
proof (state)
this:
card b1 + card b2 = vectorspace.dim K (vs W1) + vectorspace.dim K (vs W2)

goal (1 subgoal):
 1. vectorspace.dim K (vs (subspace_sum W1 W2)) \<le> vectorspace.dim K (vs W1) + vectorspace.dim K (vs W2)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
vectorspace.dim K (vs (subspace_sum W1 W2)) \<le> vectorspace.dim K (vs W1) + vectorspace.dim K (vs W2)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
vectorspace.dim K (vs (subspace_sum W1 W2)) \<le> vectorspace.dim K (vs W1) + vectorspace.dim K (vs W2)

goal (1 subgoal):
 1. vectorspace.dim K (vs (subspace_sum W1 W2)) \<le> vectorspace.dim K (vs W1) + vectorspace.dim K (vs W2)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
vectorspace.dim K (vs (subspace_sum W1 W2)) \<le> vectorspace.dim K (vs W1) + vectorspace.dim K (vs W2)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma irregular_set_swap: "(i,j) \<in> irregular_set \<epsilon> G P \<longleftrightarrow> (j,i) \<in> irregular_set \<epsilon> G P"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((i, j) \<in> irregular_set \<epsilon> G P) = ((j, i) \<in> irregular_set \<epsilon> G P)
[PROOF STEP]
by (auto simp add: irregular_set_def regular_pair_commute)


[STATEMENT]
lemma lset_intersect_lnth: "lset xs \<inter> A \<noteq> {} \<Longrightarrow> \<exists>n. enat n < llength xs \<and> lnth xs n \<in> A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lset xs \<inter> A \<noteq> {} \<Longrightarrow> \<exists>n. enat n < llength xs \<and> lnth xs n \<in> A
[PROOF STEP]
by (metis disjoint_iff_not_equal in_lset_conv_lnth)


[STATEMENT]
lemma comp_weak_lens: "\<lbrakk> weak_lens x; weak_lens y \<rbrakk> \<Longrightarrow> weak_lens (x ;\<^sub>L y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>weak_lens x; weak_lens y\<rbrakk> \<Longrightarrow> weak_lens (x ;\<^sub>L y)
[PROOF STEP]
by (unfold_locales, simp_all add: lens_comp_def)


[STATEMENT]
lemma unique_solution:
  assumes sols: "(x solves_ode f) U X" "(y solves_ode f) U X"
  assumes iv_mem: "t0 \<in> U" and subs: "U \<subseteq> T"
  assumes ivls: "is_interval U"
  assumes iv: "x t0 = y t0"
  assumes mem: "t \<in> U"
  shows "x t = y t"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x t = y t
[PROOF STEP]
by (metis unique_on_intersection assms)


[STATEMENT]
lemma prv_eql_subst_trm_id_rev:
  assumes "y \<in> var" "\<phi> \<in> fmla" and "n \<in> num"
  shows "prv (imp (eql n (Var y)) (imp \<phi> (subst \<phi> n y)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. prv (imp (eql n (Var y)) (imp \<phi> (subst \<phi> n y)))
[PROOF STEP]
using assms prv_eql_subst_trm_rev
[PROOF STATE]
proof (prove)
using this:
y \<in> var
\<phi> \<in> fmla
n \<in> num
\<lbrakk>?t1.0 \<in> trm; ?t2.0 \<in> trm; ?\<phi> \<in> fmla; ?y \<in> var\<rbrakk> \<Longrightarrow> prv (imp (eql ?t1.0 ?t2.0) (imp (subst ?\<phi> ?t2.0 ?y) (subst ?\<phi> ?t1.0 ?y)))

goal (1 subgoal):
 1. prv (imp (eql n (Var y)) (imp \<phi> (subst \<phi> n y)))
[PROOF STEP]
by (metis Var in_num subst_same_Var)


[STATEMENT]
lemma fps_divide_times:
  fixes   f g h :: "'a::{semiring_0,inverse,uminus} fps"
  assumes "subdegree h \<le> subdegree g"
  shows   "(f * g) / h = f * (g / h)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f * g / h = f * (g / h)
[PROOF STEP]
using   assms fps_mult_subdegree_ge[of g "inverse (unit_factor h)"]
          fps_shift_mult[of "subdegree h" "g * inverse (unit_factor h)" f]
[PROOF STATE]
proof (prove)
using this:
subdegree h \<le> subdegree g
g * inverse (unit_factor h) \<noteq> 0 \<Longrightarrow> subdegree g + subdegree (inverse (unit_factor h)) \<le> subdegree (g * inverse (unit_factor h))
subdegree h \<le> subdegree (g * inverse (unit_factor h)) \<Longrightarrow> fps_shift (subdegree h) (f * (g * inverse (unit_factor h))) = f * fps_shift (subdegree h) (g * inverse (unit_factor h))

goal (1 subgoal):
 1. f * g / h = f * (g / h)
[PROOF STEP]
by      (fastforce simp add: fps_divide_def mult.assoc)


[STATEMENT]
theorem kauffman_invariance:"(w1::wall) ~f w2 \<Longrightarrow> kauff_mat w1 = kauff_mat w2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. w1 ~f w2 \<Longrightarrow> kauff_mat w1 = kauff_mat w2
[PROOF STEP]
proof(induction rule:Framed_Tangle_Equivalence.induct)
[PROOF STATE]
proof (state)
goal (8 subgoals):
 1. \<And>a. kauff_mat a = kauff_mat a
 2. \<And>a b. framed_linkrel a b \<Longrightarrow> kauff_mat a = kauff_mat b
 3. \<And>a. domain_wall a = 0 \<and> is_tangle_diagram a \<Longrightarrow> kauff_mat a = kauff_mat (basic [] \<circ> a)
 4. \<And>a. codomain_wall a = 0 \<and> is_tangle_diagram a \<Longrightarrow> kauff_mat a = kauff_mat (a \<circ> basic [])
 5. \<And>B D A C. (B ~f D \<and> kauff_mat B = kauff_mat D) \<and> (A ~f C \<and> kauff_mat A = kauff_mat C) \<and> is_tangle_diagram A \<and> is_tangle_diagram B \<and> is_tangle_diagram C \<and> is_tangle_diagram D \<and> domain_wall B = codomain_wall A \<and> domain_wall D = codomain_wall C \<Longrightarrow> kauff_mat (A \<circ> B) = kauff_mat (C \<circ> D)
 6. \<And>A B C. \<lbrakk>A ~f B; kauff_mat A = kauff_mat B; B ~f C; kauff_mat B = kauff_mat C\<rbrakk> \<Longrightarrow> kauff_mat A = kauff_mat C
 7. \<And>A B. \<lbrakk>A ~f B; kauff_mat A = kauff_mat B\<rbrakk> \<Longrightarrow> kauff_mat B = kauff_mat A
 8. \<And>B D A C. (B ~f D \<and> kauff_mat B = kauff_mat D) \<and> (A ~f C \<and> kauff_mat A = kauff_mat C) \<and> is_tangle_diagram A \<and> is_tangle_diagram B \<and> is_tangle_diagram C \<and> is_tangle_diagram D \<Longrightarrow> kauff_mat (A \<otimes> B) = kauff_mat (C \<otimes> D)
[PROOF STEP]
case refl
[PROOF STATE]
proof (state)
this:

goal (8 subgoals):
 1. \<And>a. kauff_mat a = kauff_mat a
 2. \<And>a b. framed_linkrel a b \<Longrightarrow> kauff_mat a = kauff_mat b
 3. \<And>a. domain_wall a = 0 \<and> is_tangle_diagram a \<Longrightarrow> kauff_mat a = kauff_mat (basic [] \<circ> a)
 4. \<And>a. codomain_wall a = 0 \<and> is_tangle_diagram a \<Longrightarrow> kauff_mat a = kauff_mat (a \<circ> basic [])
 5. \<And>B D A C. (B ~f D \<and> kauff_mat B = kauff_mat D) \<and> (A ~f C \<and> kauff_mat A = kauff_mat C) \<and> is_tangle_diagram A \<and> is_tangle_diagram B \<and> is_tangle_diagram C \<and> is_tangle_diagram D \<and> domain_wall B = codomain_wall A \<and> domain_wall D = codomain_wall C \<Longrightarrow> kauff_mat (A \<circ> B) = kauff_mat (C \<circ> D)
 6. \<And>A B C. \<lbrakk>A ~f B; kauff_mat A = kauff_mat B; B ~f C; kauff_mat B = kauff_mat C\<rbrakk> \<Longrightarrow> kauff_mat A = kauff_mat C
 7. \<And>A B. \<lbrakk>A ~f B; kauff_mat A = kauff_mat B\<rbrakk> \<Longrightarrow> kauff_mat B = kauff_mat A
 8. \<And>B D A C. (B ~f D \<and> kauff_mat B = kauff_mat D) \<and> (A ~f C \<and> kauff_mat A = kauff_mat C) \<and> is_tangle_diagram A \<and> is_tangle_diagram B \<and> is_tangle_diagram C \<and> is_tangle_diagram D \<Longrightarrow> kauff_mat (A \<otimes> B) = kauff_mat (C \<otimes> D)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. kauff_mat a_ = kauff_mat a_
[PROOF STEP]
using refl
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. kauff_mat a_ = kauff_mat a_
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
kauff_mat a_ = kauff_mat a_

goal (7 subgoals):
 1. \<And>a b. framed_linkrel a b \<Longrightarrow> kauff_mat a = kauff_mat b
 2. \<And>a. domain_wall a = 0 \<and> is_tangle_diagram a \<Longrightarrow> kauff_mat a = kauff_mat (basic [] \<circ> a)
 3. \<And>a. codomain_wall a = 0 \<and> is_tangle_diagram a \<Longrightarrow> kauff_mat a = kauff_mat (a \<circ> basic [])
 4. \<And>B D A C. (B ~f D \<and> kauff_mat B = kauff_mat D) \<and> (A ~f C \<and> kauff_mat A = kauff_mat C) \<and> is_tangle_diagram A \<and> is_tangle_diagram B \<and> is_tangle_diagram C \<and> is_tangle_diagram D \<and> domain_wall B = codomain_wall A \<and> domain_wall D = codomain_wall C \<Longrightarrow> kauff_mat (A \<circ> B) = kauff_mat (C \<circ> D)
 5. \<And>A B C. \<lbrakk>A ~f B; kauff_mat A = kauff_mat B; B ~f C; kauff_mat B = kauff_mat C\<rbrakk> \<Longrightarrow> kauff_mat A = kauff_mat C
 6. \<And>A B. \<lbrakk>A ~f B; kauff_mat A = kauff_mat B\<rbrakk> \<Longrightarrow> kauff_mat B = kauff_mat A
 7. \<And>B D A C. (B ~f D \<and> kauff_mat B = kauff_mat D) \<and> (A ~f C \<and> kauff_mat A = kauff_mat C) \<and> is_tangle_diagram A \<and> is_tangle_diagram B \<and> is_tangle_diagram C \<and> is_tangle_diagram D \<Longrightarrow> kauff_mat (A \<otimes> B) = kauff_mat (C \<otimes> D)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (7 subgoals):
 1. \<And>a b. framed_linkrel a b \<Longrightarrow> kauff_mat a = kauff_mat b
 2. \<And>a. domain_wall a = 0 \<and> is_tangle_diagram a \<Longrightarrow> kauff_mat a = kauff_mat (basic [] \<circ> a)
 3. \<And>a. codomain_wall a = 0 \<and> is_tangle_diagram a \<Longrightarrow> kauff_mat a = kauff_mat (a \<circ> basic [])
 4. \<And>B D A C. (B ~f D \<and> kauff_mat B = kauff_mat D) \<and> (A ~f C \<and> kauff_mat A = kauff_mat C) \<and> is_tangle_diagram A \<and> is_tangle_diagram B \<and> is_tangle_diagram C \<and> is_tangle_diagram D \<and> domain_wall B = codomain_wall A \<and> domain_wall D = codomain_wall C \<Longrightarrow> kauff_mat (A \<circ> B) = kauff_mat (C \<circ> D)
 5. \<And>A B C. \<lbrakk>A ~f B; kauff_mat A = kauff_mat B; B ~f C; kauff_mat B = kauff_mat C\<rbrakk> \<Longrightarrow> kauff_mat A = kauff_mat C
 6. \<And>A B. \<lbrakk>A ~f B; kauff_mat A = kauff_mat B\<rbrakk> \<Longrightarrow> kauff_mat B = kauff_mat A
 7. \<And>B D A C. (B ~f D \<and> kauff_mat B = kauff_mat D) \<and> (A ~f C \<and> kauff_mat A = kauff_mat C) \<and> is_tangle_diagram A \<and> is_tangle_diagram B \<and> is_tangle_diagram C \<and> is_tangle_diagram D \<Longrightarrow> kauff_mat (A \<otimes> B) = kauff_mat (C \<otimes> D)
[PROOF STEP]
case sym
[PROOF STATE]
proof (state)
this:
A_ ~f B_
kauff_mat A_ = kauff_mat B_

goal (7 subgoals):
 1. \<And>a b. framed_linkrel a b \<Longrightarrow> kauff_mat a = kauff_mat b
 2. \<And>a. domain_wall a = 0 \<and> is_tangle_diagram a \<Longrightarrow> kauff_mat a = kauff_mat (basic [] \<circ> a)
 3. \<And>a. codomain_wall a = 0 \<and> is_tangle_diagram a \<Longrightarrow> kauff_mat a = kauff_mat (a \<circ> basic [])
 4. \<And>B D A C. (B ~f D \<and> kauff_mat B = kauff_mat D) \<and> (A ~f C \<and> kauff_mat A = kauff_mat C) \<and> is_tangle_diagram A \<and> is_tangle_diagram B \<and> is_tangle_diagram C \<and> is_tangle_diagram D \<and> domain_wall B = codomain_wall A \<and> domain_wall D = codomain_wall C \<Longrightarrow> kauff_mat (A \<circ> B) = kauff_mat (C \<circ> D)
 5. \<And>A B C. \<lbrakk>A ~f B; kauff_mat A = kauff_mat B; B ~f C; kauff_mat B = kauff_mat C\<rbrakk> \<Longrightarrow> kauff_mat A = kauff_mat C
 6. \<And>A B. \<lbrakk>A ~f B; kauff_mat A = kauff_mat B\<rbrakk> \<Longrightarrow> kauff_mat B = kauff_mat A
 7. \<And>B D A C. (B ~f D \<and> kauff_mat B = kauff_mat D) \<and> (A ~f C \<and> kauff_mat A = kauff_mat C) \<and> is_tangle_diagram A \<and> is_tangle_diagram B \<and> is_tangle_diagram C \<and> is_tangle_diagram D \<Longrightarrow> kauff_mat (A \<otimes> B) = kauff_mat (C \<otimes> D)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. kauff_mat B_ = kauff_mat A_
[PROOF STEP]
using sym
[PROOF STATE]
proof (prove)
using this:
A_ ~f B_
kauff_mat A_ = kauff_mat B_

goal (1 subgoal):
 1. kauff_mat B_ = kauff_mat A_
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
kauff_mat B_ = kauff_mat A_

goal (6 subgoals):
 1. \<And>a b. framed_linkrel a b \<Longrightarrow> kauff_mat a = kauff_mat b
 2. \<And>a. domain_wall a = 0 \<and> is_tangle_diagram a \<Longrightarrow> kauff_mat a = kauff_mat (basic [] \<circ> a)
 3. \<And>a. codomain_wall a = 0 \<and> is_tangle_diagram a \<Longrightarrow> kauff_mat a = kauff_mat (a \<circ> basic [])
 4. \<And>B D A C. (B ~f D \<and> kauff_mat B = kauff_mat D) \<and> (A ~f C \<and> kauff_mat A = kauff_mat C) \<and> is_tangle_diagram A \<and> is_tangle_diagram B \<and> is_tangle_diagram C \<and> is_tangle_diagram D \<and> domain_wall B = codomain_wall A \<and> domain_wall D = codomain_wall C \<Longrightarrow> kauff_mat (A \<circ> B) = kauff_mat (C \<circ> D)
 5. \<And>A B C. \<lbrakk>A ~f B; kauff_mat A = kauff_mat B; B ~f C; kauff_mat B = kauff_mat C\<rbrakk> \<Longrightarrow> kauff_mat A = kauff_mat C
 6. \<And>B D A C. (B ~f D \<and> kauff_mat B = kauff_mat D) \<and> (A ~f C \<and> kauff_mat A = kauff_mat C) \<and> is_tangle_diagram A \<and> is_tangle_diagram B \<and> is_tangle_diagram C \<and> is_tangle_diagram D \<Longrightarrow> kauff_mat (A \<otimes> B) = kauff_mat (C \<otimes> D)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (6 subgoals):
 1. \<And>a b. framed_linkrel a b \<Longrightarrow> kauff_mat a = kauff_mat b
 2. \<And>a. domain_wall a = 0 \<and> is_tangle_diagram a \<Longrightarrow> kauff_mat a = kauff_mat (basic [] \<circ> a)
 3. \<And>a. codomain_wall a = 0 \<and> is_tangle_diagram a \<Longrightarrow> kauff_mat a = kauff_mat (a \<circ> basic [])
 4. \<And>B D A C. (B ~f D \<and> kauff_mat B = kauff_mat D) \<and> (A ~f C \<and> kauff_mat A = kauff_mat C) \<and> is_tangle_diagram A \<and> is_tangle_diagram B \<and> is_tangle_diagram C \<and> is_tangle_diagram D \<and> domain_wall B = codomain_wall A \<and> domain_wall D = codomain_wall C \<Longrightarrow> kauff_mat (A \<circ> B) = kauff_mat (C \<circ> D)
 5. \<And>A B C. \<lbrakk>A ~f B; kauff_mat A = kauff_mat B; B ~f C; kauff_mat B = kauff_mat C\<rbrakk> \<Longrightarrow> kauff_mat A = kauff_mat C
 6. \<And>B D A C. (B ~f D \<and> kauff_mat B = kauff_mat D) \<and> (A ~f C \<and> kauff_mat A = kauff_mat C) \<and> is_tangle_diagram A \<and> is_tangle_diagram B \<and> is_tangle_diagram C \<and> is_tangle_diagram D \<Longrightarrow> kauff_mat (A \<otimes> B) = kauff_mat (C \<otimes> D)
[PROOF STEP]
case trans
[PROOF STATE]
proof (state)
this:
A_ ~f B_
B_ ~f C_
kauff_mat A_ = kauff_mat B_
kauff_mat B_ = kauff_mat C_

goal (6 subgoals):
 1. \<And>a b. framed_linkrel a b \<Longrightarrow> kauff_mat a = kauff_mat b
 2. \<And>a. domain_wall a = 0 \<and> is_tangle_diagram a \<Longrightarrow> kauff_mat a = kauff_mat (basic [] \<circ> a)
 3. \<And>a. codomain_wall a = 0 \<and> is_tangle_diagram a \<Longrightarrow> kauff_mat a = kauff_mat (a \<circ> basic [])
 4. \<And>B D A C. (B ~f D \<and> kauff_mat B = kauff_mat D) \<and> (A ~f C \<and> kauff_mat A = kauff_mat C) \<and> is_tangle_diagram A \<and> is_tangle_diagram B \<and> is_tangle_diagram C \<and> is_tangle_diagram D \<and> domain_wall B = codomain_wall A \<and> domain_wall D = codomain_wall C \<Longrightarrow> kauff_mat (A \<circ> B) = kauff_mat (C \<circ> D)
 5. \<And>A B C. \<lbrakk>A ~f B; kauff_mat A = kauff_mat B; B ~f C; kauff_mat B = kauff_mat C\<rbrakk> \<Longrightarrow> kauff_mat A = kauff_mat C
 6. \<And>B D A C. (B ~f D \<and> kauff_mat B = kauff_mat D) \<and> (A ~f C \<and> kauff_mat A = kauff_mat C) \<and> is_tangle_diagram A \<and> is_tangle_diagram B \<and> is_tangle_diagram C \<and> is_tangle_diagram D \<Longrightarrow> kauff_mat (A \<otimes> B) = kauff_mat (C \<otimes> D)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. kauff_mat A_ = kauff_mat C_
[PROOF STEP]
using trans
[PROOF STATE]
proof (prove)
using this:
A_ ~f B_
B_ ~f C_
kauff_mat A_ = kauff_mat B_
kauff_mat B_ = kauff_mat C_

goal (1 subgoal):
 1. kauff_mat A_ = kauff_mat C_
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
kauff_mat A_ = kauff_mat C_

goal (5 subgoals):
 1. \<And>a b. framed_linkrel a b \<Longrightarrow> kauff_mat a = kauff_mat b
 2. \<And>a. domain_wall a = 0 \<and> is_tangle_diagram a \<Longrightarrow> kauff_mat a = kauff_mat (basic [] \<circ> a)
 3. \<And>a. codomain_wall a = 0 \<and> is_tangle_diagram a \<Longrightarrow> kauff_mat a = kauff_mat (a \<circ> basic [])
 4. \<And>B D A C. (B ~f D \<and> kauff_mat B = kauff_mat D) \<and> (A ~f C \<and> kauff_mat A = kauff_mat C) \<and> is_tangle_diagram A \<and> is_tangle_diagram B \<and> is_tangle_diagram C \<and> is_tangle_diagram D \<and> domain_wall B = codomain_wall A \<and> domain_wall D = codomain_wall C \<Longrightarrow> kauff_mat (A \<circ> B) = kauff_mat (C \<circ> D)
 5. \<And>B D A C. (B ~f D \<and> kauff_mat B = kauff_mat D) \<and> (A ~f C \<and> kauff_mat A = kauff_mat C) \<and> is_tangle_diagram A \<and> is_tangle_diagram B \<and> is_tangle_diagram C \<and> is_tangle_diagram D \<Longrightarrow> kauff_mat (A \<otimes> B) = kauff_mat (C \<otimes> D)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (5 subgoals):
 1. \<And>a b. framed_linkrel a b \<Longrightarrow> kauff_mat a = kauff_mat b
 2. \<And>a. domain_wall a = 0 \<and> is_tangle_diagram a \<Longrightarrow> kauff_mat a = kauff_mat (basic [] \<circ> a)
 3. \<And>a. codomain_wall a = 0 \<and> is_tangle_diagram a \<Longrightarrow> kauff_mat a = kauff_mat (a \<circ> basic [])
 4. \<And>B D A C. (B ~f D \<and> kauff_mat B = kauff_mat D) \<and> (A ~f C \<and> kauff_mat A = kauff_mat C) \<and> is_tangle_diagram A \<and> is_tangle_diagram B \<and> is_tangle_diagram C \<and> is_tangle_diagram D \<and> domain_wall B = codomain_wall A \<and> domain_wall D = codomain_wall C \<Longrightarrow> kauff_mat (A \<circ> B) = kauff_mat (C \<circ> D)
 5. \<And>B D A C. (B ~f D \<and> kauff_mat B = kauff_mat D) \<and> (A ~f C \<and> kauff_mat A = kauff_mat C) \<and> is_tangle_diagram A \<and> is_tangle_diagram B \<and> is_tangle_diagram C \<and> is_tangle_diagram D \<Longrightarrow> kauff_mat (A \<otimes> B) = kauff_mat (C \<otimes> D)
[PROOF STEP]
case compose_eq
[PROOF STATE]
proof (state)
this:
(B_ ~f D_ \<and> kauff_mat B_ = kauff_mat D_) \<and> (A_ ~f C_ \<and> kauff_mat A_ = kauff_mat C_) \<and> is_tangle_diagram A_ \<and> is_tangle_diagram B_ \<and> is_tangle_diagram C_ \<and> is_tangle_diagram D_ \<and> domain_wall B_ = codomain_wall A_ \<and> domain_wall D_ = codomain_wall C_

goal (5 subgoals):
 1. \<And>a b. framed_linkrel a b \<Longrightarrow> kauff_mat a = kauff_mat b
 2. \<And>a. domain_wall a = 0 \<and> is_tangle_diagram a \<Longrightarrow> kauff_mat a = kauff_mat (basic [] \<circ> a)
 3. \<And>a. codomain_wall a = 0 \<and> is_tangle_diagram a \<Longrightarrow> kauff_mat a = kauff_mat (a \<circ> basic [])
 4. \<And>B D A C. (B ~f D \<and> kauff_mat B = kauff_mat D) \<and> (A ~f C \<and> kauff_mat A = kauff_mat C) \<and> is_tangle_diagram A \<and> is_tangle_diagram B \<and> is_tangle_diagram C \<and> is_tangle_diagram D \<and> domain_wall B = codomain_wall A \<and> domain_wall D = codomain_wall C \<Longrightarrow> kauff_mat (A \<circ> B) = kauff_mat (C \<circ> D)
 5. \<And>B D A C. (B ~f D \<and> kauff_mat B = kauff_mat D) \<and> (A ~f C \<and> kauff_mat A = kauff_mat C) \<and> is_tangle_diagram A \<and> is_tangle_diagram B \<and> is_tangle_diagram C \<and> is_tangle_diagram D \<Longrightarrow> kauff_mat (A \<otimes> B) = kauff_mat (C \<otimes> D)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. kauff_mat (A_ \<circ> B_) = kauff_mat (C_ \<circ> D_)
[PROOF STEP]
using compose_eq tangle_compose_matrix
[PROOF STATE]
proof (prove)
using this:
(B_ ~f D_ \<and> kauff_mat B_ = kauff_mat D_) \<and> (A_ ~f C_ \<and> kauff_mat A_ = kauff_mat C_) \<and> is_tangle_diagram A_ \<and> is_tangle_diagram B_ \<and> is_tangle_diagram C_ \<and> is_tangle_diagram D_ \<and> domain_wall B_ = codomain_wall A_ \<and> domain_wall D_ = codomain_wall C_
is_tangle_diagram ?ws1.0 \<and> is_tangle_diagram ?ws2.0 \<and> domain_wall ?ws2.0 = codomain_wall ?ws1.0 \<Longrightarrow> kauff_mat (?ws1.0 \<circ> ?ws2.0) = rat_poly.matrix_mult (kauff_mat ?ws1.0) (kauff_mat ?ws2.0)

goal (1 subgoal):
 1. kauff_mat (A_ \<circ> B_) = kauff_mat (C_ \<circ> D_)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
kauff_mat (A_ \<circ> B_) = kauff_mat (C_ \<circ> D_)

goal (4 subgoals):
 1. \<And>a b. framed_linkrel a b \<Longrightarrow> kauff_mat a = kauff_mat b
 2. \<And>a. domain_wall a = 0 \<and> is_tangle_diagram a \<Longrightarrow> kauff_mat a = kauff_mat (basic [] \<circ> a)
 3. \<And>a. codomain_wall a = 0 \<and> is_tangle_diagram a \<Longrightarrow> kauff_mat a = kauff_mat (a \<circ> basic [])
 4. \<And>B D A C. (B ~f D \<and> kauff_mat B = kauff_mat D) \<and> (A ~f C \<and> kauff_mat A = kauff_mat C) \<and> is_tangle_diagram A \<and> is_tangle_diagram B \<and> is_tangle_diagram C \<and> is_tangle_diagram D \<Longrightarrow> kauff_mat (A \<otimes> B) = kauff_mat (C \<otimes> D)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. \<And>a b. framed_linkrel a b \<Longrightarrow> kauff_mat a = kauff_mat b
 2. \<And>a. domain_wall a = 0 \<and> is_tangle_diagram a \<Longrightarrow> kauff_mat a = kauff_mat (basic [] \<circ> a)
 3. \<And>a. codomain_wall a = 0 \<and> is_tangle_diagram a \<Longrightarrow> kauff_mat a = kauff_mat (a \<circ> basic [])
 4. \<And>B D A C. (B ~f D \<and> kauff_mat B = kauff_mat D) \<and> (A ~f C \<and> kauff_mat A = kauff_mat C) \<and> is_tangle_diagram A \<and> is_tangle_diagram B \<and> is_tangle_diagram C \<and> is_tangle_diagram D \<Longrightarrow> kauff_mat (A \<otimes> B) = kauff_mat (C \<otimes> D)
[PROOF STEP]
case codomain_compose
[PROOF STATE]
proof (state)
this:
codomain_wall a_ = 0 \<and> is_tangle_diagram a_

goal (4 subgoals):
 1. \<And>a b. framed_linkrel a b \<Longrightarrow> kauff_mat a = kauff_mat b
 2. \<And>a. domain_wall a = 0 \<and> is_tangle_diagram a \<Longrightarrow> kauff_mat a = kauff_mat (basic [] \<circ> a)
 3. \<And>a. codomain_wall a = 0 \<and> is_tangle_diagram a \<Longrightarrow> kauff_mat a = kauff_mat (a \<circ> basic [])
 4. \<And>B D A C. (B ~f D \<and> kauff_mat B = kauff_mat D) \<and> (A ~f C \<and> kauff_mat A = kauff_mat C) \<and> is_tangle_diagram A \<and> is_tangle_diagram B \<and> is_tangle_diagram C \<and> is_tangle_diagram D \<Longrightarrow> kauff_mat (A \<otimes> B) = kauff_mat (C \<otimes> D)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. kauff_mat a_ = kauff_mat (a_ \<circ> basic [])
[PROOF STEP]
using codomain_compose left_mat_compose
[PROOF STATE]
proof (prove)
using this:
codomain_wall a_ = 0 \<and> is_tangle_diagram a_
\<lbrakk>is_tangle_diagram ?ws; codomain_wall ?ws = 0\<rbrakk> \<Longrightarrow> kauff_mat ?ws = kauff_mat (?ws \<circ> basic [])

goal (1 subgoal):
 1. kauff_mat a_ = kauff_mat (a_ \<circ> basic [])
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
kauff_mat a_ = kauff_mat (a_ \<circ> basic [])

goal (3 subgoals):
 1. \<And>a b. framed_linkrel a b \<Longrightarrow> kauff_mat a = kauff_mat b
 2. \<And>a. domain_wall a = 0 \<and> is_tangle_diagram a \<Longrightarrow> kauff_mat a = kauff_mat (basic [] \<circ> a)
 3. \<And>B D A C. (B ~f D \<and> kauff_mat B = kauff_mat D) \<and> (A ~f C \<and> kauff_mat A = kauff_mat C) \<and> is_tangle_diagram A \<and> is_tangle_diagram B \<and> is_tangle_diagram C \<and> is_tangle_diagram D \<Longrightarrow> kauff_mat (A \<otimes> B) = kauff_mat (C \<otimes> D)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>a b. framed_linkrel a b \<Longrightarrow> kauff_mat a = kauff_mat b
 2. \<And>a. domain_wall a = 0 \<and> is_tangle_diagram a \<Longrightarrow> kauff_mat a = kauff_mat (basic [] \<circ> a)
 3. \<And>B D A C. (B ~f D \<and> kauff_mat B = kauff_mat D) \<and> (A ~f C \<and> kauff_mat A = kauff_mat C) \<and> is_tangle_diagram A \<and> is_tangle_diagram B \<and> is_tangle_diagram C \<and> is_tangle_diagram D \<Longrightarrow> kauff_mat (A \<otimes> B) = kauff_mat (C \<otimes> D)
[PROOF STEP]
case domain_compose
[PROOF STATE]
proof (state)
this:
domain_wall a_ = 0 \<and> is_tangle_diagram a_

goal (3 subgoals):
 1. \<And>a b. framed_linkrel a b \<Longrightarrow> kauff_mat a = kauff_mat b
 2. \<And>a. domain_wall a = 0 \<and> is_tangle_diagram a \<Longrightarrow> kauff_mat a = kauff_mat (basic [] \<circ> a)
 3. \<And>B D A C. (B ~f D \<and> kauff_mat B = kauff_mat D) \<and> (A ~f C \<and> kauff_mat A = kauff_mat C) \<and> is_tangle_diagram A \<and> is_tangle_diagram B \<and> is_tangle_diagram C \<and> is_tangle_diagram D \<Longrightarrow> kauff_mat (A \<otimes> B) = kauff_mat (C \<otimes> D)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. kauff_mat a_ = kauff_mat (basic [] \<circ> a_)
[PROOF STEP]
using domain_compose right_mat_compose
[PROOF STATE]
proof (prove)
using this:
domain_wall a_ = 0 \<and> is_tangle_diagram a_
\<lbrakk>is_tangle_diagram ?ws; domain_wall ?ws = 0\<rbrakk> \<Longrightarrow> kauff_mat ?ws = kauff_mat (basic [] \<circ> ?ws)

goal (1 subgoal):
 1. kauff_mat a_ = kauff_mat (basic [] \<circ> a_)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
kauff_mat a_ = kauff_mat (basic [] \<circ> a_)

goal (2 subgoals):
 1. \<And>a b. framed_linkrel a b \<Longrightarrow> kauff_mat a = kauff_mat b
 2. \<And>B D A C. (B ~f D \<and> kauff_mat B = kauff_mat D) \<and> (A ~f C \<and> kauff_mat A = kauff_mat C) \<and> is_tangle_diagram A \<and> is_tangle_diagram B \<and> is_tangle_diagram C \<and> is_tangle_diagram D \<Longrightarrow> kauff_mat (A \<otimes> B) = kauff_mat (C \<otimes> D)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>a b. framed_linkrel a b \<Longrightarrow> kauff_mat a = kauff_mat b
 2. \<And>B D A C. (B ~f D \<and> kauff_mat B = kauff_mat D) \<and> (A ~f C \<and> kauff_mat A = kauff_mat C) \<and> is_tangle_diagram A \<and> is_tangle_diagram B \<and> is_tangle_diagram C \<and> is_tangle_diagram D \<Longrightarrow> kauff_mat (A \<otimes> B) = kauff_mat (C \<otimes> D)
[PROOF STEP]
case tensor_eq
[PROOF STATE]
proof (state)
this:
(B_ ~f D_ \<and> kauff_mat B_ = kauff_mat D_) \<and> (A_ ~f C_ \<and> kauff_mat A_ = kauff_mat C_) \<and> is_tangle_diagram A_ \<and> is_tangle_diagram B_ \<and> is_tangle_diagram C_ \<and> is_tangle_diagram D_

goal (2 subgoals):
 1. \<And>a b. framed_linkrel a b \<Longrightarrow> kauff_mat a = kauff_mat b
 2. \<And>B D A C. (B ~f D \<and> kauff_mat B = kauff_mat D) \<and> (A ~f C \<and> kauff_mat A = kauff_mat C) \<and> is_tangle_diagram A \<and> is_tangle_diagram B \<and> is_tangle_diagram C \<and> is_tangle_diagram D \<Longrightarrow> kauff_mat (A \<otimes> B) = kauff_mat (C \<otimes> D)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. kauff_mat (A_ \<otimes> B_) = kauff_mat (C_ \<otimes> D_)
[PROOF STEP]
using  tensor_eq.IH Tensor_Invariance
[PROOF STATE]
proof (prove)
using this:
(B_ ~f D_ \<and> kauff_mat B_ = kauff_mat D_) \<and> (A_ ~f C_ \<and> kauff_mat A_ = kauff_mat C_) \<and> is_tangle_diagram A_ \<and> is_tangle_diagram B_ \<and> is_tangle_diagram C_ \<and> is_tangle_diagram D_
is_tangle_diagram ?ws1.0 \<and> is_tangle_diagram ?ws2.0 \<Longrightarrow> kauff_mat (?ws1.0 \<otimes> ?ws2.0) = kauff_mat ?ws1.0 \<otimes> kauff_mat ?ws2.0

goal (1 subgoal):
 1. kauff_mat (A_ \<otimes> B_) = kauff_mat (C_ \<otimes> D_)
[PROOF STEP]
by (metis)
[PROOF STATE]
proof (state)
this:
kauff_mat (A_ \<otimes> B_) = kauff_mat (C_ \<otimes> D_)

goal (1 subgoal):
 1. \<And>a b. framed_linkrel a b \<Longrightarrow> kauff_mat a = kauff_mat b
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a b. framed_linkrel a b \<Longrightarrow> kauff_mat a = kauff_mat b
[PROOF STEP]
case equality
[PROOF STATE]
proof (state)
this:
framed_linkrel a_ b_

goal (1 subgoal):
 1. \<And>a b. framed_linkrel a b \<Longrightarrow> kauff_mat a = kauff_mat b
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. kauff_mat a_ = kauff_mat b_
[PROOF STEP]
using framed_linkrel_inv equality
[PROOF STATE]
proof (prove)
using this:
framed_linkrel ?w1.0 ?w2.0 \<Longrightarrow> kauff_mat ?w1.0 = kauff_mat ?w2.0
framed_linkrel a_ b_

goal (1 subgoal):
 1. kauff_mat a_ = kauff_mat b_
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
kauff_mat a_ = kauff_mat b_

goal:
No subgoals!
[PROOF STEP]
qed