[STATEMENT]
lemma little_Fermat_nat:
  fixes a :: nat
  assumes "prime p" "\<not>p dvd a"
  shows   "[a ^ p = a] (mod p)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. [a ^ p = a] (mod p)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. [a ^ p = a] (mod p)
[PROOF STEP]
have "p = Suc (p - 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. p = Suc (p - 1)
[PROOF STEP]
using prime_gt_0_nat[OF assms(1)]
[PROOF STATE]
proof (prove)
using this:
0 < p

goal (1 subgoal):
 1. p = Suc (p - 1)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
p = Suc (p - 1)

goal (1 subgoal):
 1. [a ^ p = a] (mod p)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
p = Suc (p - 1)

goal (1 subgoal):
 1. [a ^ p = a] (mod p)
[PROOF STEP]
have "p - 1 = totient p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. p - 1 = totient p
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
prime p
\<not> p dvd a

goal (1 subgoal):
 1. p - 1 = totient p
[PROOF STEP]
by (simp add: totient_prime)
[PROOF STATE]
proof (state)
this:
p - 1 = totient p

goal (1 subgoal):
 1. [a ^ p = a] (mod p)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
p - 1 = totient p

goal (1 subgoal):
 1. [a ^ p = a] (mod p)
[PROOF STEP]
have "a ^ (Suc \<dots>) = a * a ^ totient p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a ^ Suc (totient p) = a * a ^ totient p
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
a ^ Suc (totient p) = a * a ^ totient p

goal (1 subgoal):
 1. [a ^ p = a] (mod p)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
a ^ Suc (totient p) = a * a ^ totient p

goal (1 subgoal):
 1. [a ^ p = a] (mod p)
[PROOF STEP]
have "[\<dots> = a * 1] (mod p)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. [a * a ^ totient p = a * 1] (mod p)
[PROOF STEP]
using prime_imp_coprime[of p a] assms
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>prime p; \<not> p dvd a\<rbrakk> \<Longrightarrow> coprime p a
prime p
\<not> p dvd a

goal (1 subgoal):
 1. [a * a ^ totient p = a * 1] (mod p)
[PROOF STEP]
by (intro cong_mult cong_refl euler_theorem) (auto simp: coprime_commute)
[PROOF STATE]
proof (state)
this:
[a * a ^ totient p = a * 1] (mod p)

goal (1 subgoal):
 1. [a ^ p = a] (mod p)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
[a ^ p = a * 1] (mod p)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
[a ^ p = a * 1] (mod p)

goal (1 subgoal):
 1. [a ^ p = a] (mod p)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
[a ^ p = a] (mod p)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
theorem marriage_necessary:
  fixes A :: "'a \<Rightarrow> 'b set" and I :: "'a set"
  assumes "finite I" and "\<forall> i\<in>I. finite (A i)"
  and "\<exists>R. (\<forall>i\<in>I. R i \<in> A i) \<and> inj_on R I" (is "\<exists>R. ?R R A & ?inj R A")
  shows "\<forall>J\<subseteq>I. card J \<le> card (\<Union>(A ` J))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>J\<subseteq>I. card J \<le> card (\<Union> (A ` J))
[PROOF STEP]
proof clarify
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>J. J \<subseteq> I \<Longrightarrow> card J \<le> card (\<Union> (A ` J))
[PROOF STEP]
fix J
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>J. J \<subseteq> I \<Longrightarrow> card J \<le> card (\<Union> (A ` J))
[PROOF STEP]
assume "J \<subseteq> I"
[PROOF STATE]
proof (state)
this:
J \<subseteq> I

goal (1 subgoal):
 1. \<And>J. J \<subseteq> I \<Longrightarrow> card J \<le> card (\<Union> (A ` J))
[PROOF STEP]
show "card J \<le> card (\<Union>(A ` J))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card J \<le> card (\<Union> (A ` J))
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. card J \<le> card (\<Union> (A ` J))
[PROOF STEP]
from assms(3)
[PROOF STATE]
proof (chain)
picking this:
\<exists>R. (\<forall>i\<in>I. R i \<in> A i) \<and> inj_on R I
[PROOF STEP]
obtain R where "?R R A" and "?inj R A"
[PROOF STATE]
proof (prove)
using this:
\<exists>R. (\<forall>i\<in>I. R i \<in> A i) \<and> inj_on R I

goal (1 subgoal):
 1. (\<And>R. \<lbrakk>\<forall>i\<in>I. R i \<in> A i; inj_on R I\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<forall>i\<in>I. R i \<in> A i
inj_on R I

goal (1 subgoal):
 1. card J \<le> card (\<Union> (A ` J))
[PROOF STEP]
have "inj_on R J"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inj_on R J
[PROOF STEP]
by(rule subset_inj_on[OF \<open>?inj R A\<close> \<open>J\<subseteq>I\<close>])
[PROOF STATE]
proof (state)
this:
inj_on R J

goal (1 subgoal):
 1. card J \<le> card (\<Union> (A ` J))
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
inj_on R J

goal (1 subgoal):
 1. card J \<le> card (\<Union> (A ` J))
[PROOF STEP]
have "(R ` J) \<subseteq> (\<Union>(A ` J))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. R ` J \<subseteq> \<Union> (A ` J)
[PROOF STEP]
using \<open>J\<subseteq>I\<close> \<open>?R R A\<close>
[PROOF STATE]
proof (prove)
using this:
J \<subseteq> I
\<forall>i\<in>I. R i \<in> A i

goal (1 subgoal):
 1. R ` J \<subseteq> \<Union> (A ` J)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
R ` J \<subseteq> \<Union> (A ` J)

goal (1 subgoal):
 1. card J \<le> card (\<Union> (A ` J))
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
R ` J \<subseteq> \<Union> (A ` J)

goal (1 subgoal):
 1. card J \<le> card (\<Union> (A ` J))
[PROOF STEP]
have "finite (\<Union>(A ` J))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (\<Union> (A ` J))
[PROOF STEP]
using \<open>J\<subseteq>I\<close> assms
[PROOF STATE]
proof (prove)
using this:
J \<subseteq> I
finite I
\<forall>i\<in>I. finite (A i)
\<exists>R. (\<forall>i\<in>I. R i \<in> A i) \<and> inj_on R I

goal (1 subgoal):
 1. finite (\<Union> (A ` J))
[PROOF STEP]
by (metis finite_UN_I finite_subset subsetD)
[PROOF STATE]
proof (state)
this:
finite (\<Union> (A ` J))

goal (1 subgoal):
 1. card J \<le> card (\<Union> (A ` J))
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
inj_on R J
R ` J \<subseteq> \<Union> (A ` J)
finite (\<Union> (A ` J))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
inj_on R J
R ` J \<subseteq> \<Union> (A ` J)
finite (\<Union> (A ` J))

goal (1 subgoal):
 1. card J \<le> card (\<Union> (A ` J))
[PROOF STEP]
by (rule card_inj_on_le)
[PROOF STATE]
proof (state)
this:
card J \<le> card (\<Union> (A ` J))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
card J \<le> card (\<Union> (A ` J))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma reflect_poly_prod_list: "reflect_poly (prod_list xs) = prod_list (map reflect_poly xs)"
  for xs :: "_::{comm_semiring_0,semiring_no_zero_divisors} poly list"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. reflect_poly (prod_list xs) = prod_list (map reflect_poly xs)
[PROOF STEP]
by (induct xs) (simp_all add: reflect_poly_mult)


[STATEMENT]
lemma option_Max_by_eqI:
  "\<lbrakk> (S = {}) \<longleftrightarrow> (S' = {}); S \<noteq> {} \<and> S' \<noteq> {} \<Longrightarrow> Max_by f S = Max_by g S' \<rbrakk>
  \<Longrightarrow>  option_Max_by f S = option_Max_by g S'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>(S = {}) = (S' = {}); S \<noteq> {} \<and> S' \<noteq> {} \<Longrightarrow> Max_by f S = Max_by g S'\<rbrakk> \<Longrightarrow> option_Max_by f S = option_Max_by g S'
[PROOF STEP]
by(auto simp add: option_Max_by_def)


[STATEMENT]
lemma (in Module) Ann_is_ideal:"ideal R (Ann\<^bsub>R\<^esub> M)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ideal R (Ann\<^bsub>R\<^esub> M)
[PROOF STEP]
apply (simp add:Annihilator_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ideal R ({\<zero>} \<^bsub>R\<ddagger>M\<^esub> carrier M)
[PROOF STEP]
apply (rule quotient_of_submodules_is_ideal)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. submodule R M {\<zero>}
 2. submodule R M (carrier M)
[PROOF STEP]
apply (simp add:submodule_0)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. submodule R M (carrier M)
[PROOF STEP]
apply (simp add:submodule_whole)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma is_cycle_rev: "is_cycle xs \<longleftrightarrow> is_cycle (rev xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_cycle xs = is_cycle (rev xs)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. is_cycle xs = is_cycle (rev xs)
[PROOF STEP]
have len: "1 \<le> walk_length xs \<longleftrightarrow> 1 \<le> walk_length (rev xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (1 \<le> walk_length xs) = (1 \<le> walk_length (rev xs))
[PROOF STEP]
by (metis length_rev walk_edges_rev walk_length_def)
[PROOF STATE]
proof (state)
this:
(1 \<le> walk_length xs) = (1 \<le> walk_length (rev xs))

goal (1 subgoal):
 1. is_cycle xs = is_cycle (rev xs)
[PROOF STEP]
have "hd xs = last xs \<Longrightarrow> distinct (tl xs) \<longleftrightarrow> distinct (tl (rev xs))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. hd xs = last xs \<Longrightarrow> distinct (tl xs) = distinct (tl (rev xs))
[PROOF STEP]
using distinct_tl_rev
[PROOF STATE]
proof (prove)
using this:
hd ?xs = last ?xs \<Longrightarrow> distinct (tl ?xs) = distinct (tl (rev ?xs))

goal (1 subgoal):
 1. hd xs = last xs \<Longrightarrow> distinct (tl xs) = distinct (tl (rev xs))
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
hd xs = last xs \<Longrightarrow> distinct (tl xs) = distinct (tl (rev xs))

goal (1 subgoal):
 1. is_cycle xs = is_cycle (rev xs)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
hd xs = last xs \<Longrightarrow> distinct (tl xs) = distinct (tl (rev xs))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
hd xs = last xs \<Longrightarrow> distinct (tl xs) = distinct (tl (rev xs))

goal (1 subgoal):
 1. is_cycle xs = is_cycle (rev xs)
[PROOF STEP]
using len is_cycle_def
[PROOF STATE]
proof (prove)
using this:
hd xs = last xs \<Longrightarrow> distinct (tl xs) = distinct (tl (rev xs))
(1 \<le> walk_length xs) = (1 \<le> walk_length (rev xs))
is_cycle ?xs \<equiv> is_closed_walk ?xs \<and> 1 \<le> walk_length ?xs \<and> distinct (tl ?xs)

goal (1 subgoal):
 1. is_cycle xs = is_cycle (rev xs)
[PROOF STEP]
using is_closed_walk_def is_closed_walk_rev
[PROOF STATE]
proof (prove)
using this:
hd xs = last xs \<Longrightarrow> distinct (tl xs) = distinct (tl (rev xs))
(1 \<le> walk_length xs) = (1 \<le> walk_length (rev xs))
is_cycle ?xs \<equiv> is_closed_walk ?xs \<and> 1 \<le> walk_length ?xs \<and> distinct (tl ?xs)
is_closed_walk ?xs \<equiv> is_walk ?xs \<and> hd ?xs = last ?xs
is_closed_walk ?xs = is_closed_walk (rev ?xs)

goal (1 subgoal):
 1. is_cycle xs = is_cycle (rev xs)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
is_cycle xs = is_cycle (rev xs)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma periodic_arithmetic_sum_periodic_arithmetic_shift:
  fixes k d :: nat
  assumes "periodic_arithmetic f k" "k > 0" "d > 0"
  shows "(\<Sum>l \<in> {0..k-1}. f l) = (\<Sum>l \<in> {d..d+k-1}. f l)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum f {0..k - 1} = sum f {d..d + k - 1}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. sum f {0..k - 1} = sum f {d..d + k - 1}
[PROOF STEP]
have "(\<Sum>l \<in> {0..k-1}. f l) = (\<Sum>l \<in> {0..<k}. f l)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum f {0..k - 1} = sum f {0..<k}
[PROOF STEP]
using assms(2)
[PROOF STATE]
proof (prove)
using this:
0 < k

goal (1 subgoal):
 1. sum f {0..k - 1} = sum f {0..<k}
[PROOF STEP]
by (intro sum.cong) auto
[PROOF STATE]
proof (state)
this:
sum f {0..k - 1} = sum f {0..<k}

goal (1 subgoal):
 1. sum f {0..k - 1} = sum f {d..d + k - 1}
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
sum f {0..k - 1} = sum f {0..<k}

goal (1 subgoal):
 1. sum f {0..k - 1} = sum f {d..d + k - 1}
[PROOF STEP]
have "\<dots> = (\<Sum>l \<in> {d..<d+k}. f (l mod k))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum f {0..<k} = (\<Sum>l = d..<d + k. f (l mod k))
[PROOF STEP]
using assms(2)
[PROOF STATE]
proof (prove)
using this:
0 < k

goal (1 subgoal):
 1. sum f {0..<k} = (\<Sum>l = d..<d + k. f (l mod k))
[PROOF STEP]
by (simp add: sum.reindex_bij_betw[OF bij_betw_mod_nat_atLeastLessThan[of k d]]
                  lessThan_atLeast0)
[PROOF STATE]
proof (state)
this:
sum f {0..<k} = (\<Sum>l = d..<d + k. f (l mod k))

goal (1 subgoal):
 1. sum f {0..k - 1} = sum f {d..d + k - 1}
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
sum f {0..<k} = (\<Sum>l = d..<d + k. f (l mod k))

goal (1 subgoal):
 1. sum f {0..k - 1} = sum f {d..d + k - 1}
[PROOF STEP]
have "\<dots> = (\<Sum>l \<in> {d..<d+k}. f l)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>l = d..<d + k. f (l mod k)) = sum f {d..<d + k}
[PROOF STEP]
using mod_periodic_arithmetic[of f k] assms(1) sum.cong
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>periodic_arithmetic f k; ?n mod k = ?m mod k\<rbrakk> \<Longrightarrow> f ?n = f ?m
periodic_arithmetic f k
\<lbrakk>?A = ?B; \<And>x. x \<in> ?B \<Longrightarrow> ?g x = ?h x\<rbrakk> \<Longrightarrow> sum ?g ?A = sum ?h ?B

goal (1 subgoal):
 1. (\<Sum>l = d..<d + k. f (l mod k)) = sum f {d..<d + k}
[PROOF STEP]
by (meson mod_mod_trivial)
[PROOF STATE]
proof (state)
this:
(\<Sum>l = d..<d + k. f (l mod k)) = sum f {d..<d + k}

goal (1 subgoal):
 1. sum f {0..k - 1} = sum f {d..d + k - 1}
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>l = d..<d + k. f (l mod k)) = sum f {d..<d + k}

goal (1 subgoal):
 1. sum f {0..k - 1} = sum f {d..d + k - 1}
[PROOF STEP]
have "\<dots> = (\<Sum>l \<in> {d..d+k-1}. f l)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum f {d..<d + k} = sum f {d..d + k - 1}
[PROOF STEP]
using assms(2,3)
[PROOF STATE]
proof (prove)
using this:
0 < k
0 < d

goal (1 subgoal):
 1. sum f {d..<d + k} = sum f {d..d + k - 1}
[PROOF STEP]
by (intro sum.cong) auto
[PROOF STATE]
proof (state)
this:
sum f {d..<d + k} = sum f {d..d + k - 1}

goal (1 subgoal):
 1. sum f {0..k - 1} = sum f {d..d + k - 1}
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
sum f {0..k - 1} = sum f {d..d + k - 1}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
sum f {0..k - 1} = sum f {d..d + k - 1}

goal (1 subgoal):
 1. sum f {0..k - 1} = sum f {d..d + k - 1}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
sum f {0..k - 1} = sum f {d..d + k - 1}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma coeff_int_sum: "coeff_int (sum p A) i = (\<Sum>x\<in>A. coeff_int (p x) i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. coeff_int (sum p A) i = (\<Sum>x\<in>A. coeff_int (p x) i)
[PROOF STEP]
using coeff_sum[of p A "nat i"]
[PROOF STATE]
proof (prove)
using this:
coeff (sum p A) (nat i) = (\<Sum>x\<in>A. coeff (p x) (nat i))

goal (1 subgoal):
 1. coeff_int (sum p A) i = (\<Sum>x\<in>A. coeff_int (p x) i)
[PROOF STEP]
unfolding coeff_int_def
[PROOF STATE]
proof (prove)
using this:
coeff (sum p A) (nat i) = (\<Sum>x\<in>A. coeff (p x) (nat i))

goal (1 subgoal):
 1. (if i < 0 then 0::'a else coeff (sum p A) (nat i)) = (\<Sum>x\<in>A. if i < 0 then 0::'a else coeff (p x) (nat i))
[PROOF STEP]
by (cases "i < 0", auto)


[STATEMENT]
lemma continuous_within_tendsto_compose:
  fixes f::"'a::t2_space \<Rightarrow> 'b::topological_space"
  assumes "continuous (at a within s) f"
          "eventually (\<lambda>n. x n \<in> s) F"
          "(x \<longlongrightarrow> a) F "
  shows "((\<lambda>n. f (x n)) \<longlongrightarrow> f a) F"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>n. f (x n)) \<longlongrightarrow> f a) F
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. ((\<lambda>n. f (x n)) \<longlongrightarrow> f a) F
[PROOF STEP]
have *: "filterlim x (inf (nhds a) (principal s)) F"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. filterlim x (inf (nhds a) (principal s)) F
[PROOF STEP]
using assms(2) assms(3)
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F n in F. x n \<in> s
(x \<longlongrightarrow> a) F

goal (1 subgoal):
 1. filterlim x (inf (nhds a) (principal s)) F
[PROOF STEP]
unfolding at_within_def filterlim_inf
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F n in F. x n \<in> s
(x \<longlongrightarrow> a) F

goal (1 subgoal):
 1. (x \<longlongrightarrow> a) F \<and> filterlim x (principal s) F
[PROOF STEP]
by (auto simp: filterlim_principal eventually_mono)
[PROOF STATE]
proof (state)
this:
filterlim x (inf (nhds a) (principal s)) F

goal (1 subgoal):
 1. ((\<lambda>n. f (x n)) \<longlongrightarrow> f a) F
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>n. f (x n)) \<longlongrightarrow> f a) F
[PROOF STEP]
by (auto simp: assms(1) continuous_within[symmetric] tendsto_at_within_iff_tendsto_nhds[symmetric] intro!: filterlim_compose[OF _ *])
[PROOF STATE]
proof (state)
this:
((\<lambda>n. f (x n)) \<longlongrightarrow> f a) F

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma in_segment_inner_rot2:
  "(x - y) \<bullet> rot (a - b) = 0"
  if "x \<in> {a--b}" "y \<in> {a--b}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x - y) \<bullet> rot (a - b) = 0
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (x - y) \<bullet> rot (a - b) = 0
[PROOF STEP]
from that
[PROOF STATE]
proof (chain)
picking this:
x \<in> {a--b}
y \<in> {a--b}
[PROOF STEP]
obtain u where x: "x = a + u *\<^sub>R (b - a)" "0 \<le> u" "u \<le> 1"
[PROOF STATE]
proof (prove)
using this:
x \<in> {a--b}
y \<in> {a--b}

goal (1 subgoal):
 1. (\<And>u. \<lbrakk>x = a + u *\<^sub>R (b - a); 0 \<le> u; u \<le> 1\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (auto simp: in_segment algebra_simps)
[PROOF STATE]
proof (state)
this:
x = a + u *\<^sub>R (b - a)
0 \<le> u
u \<le> 1

goal (1 subgoal):
 1. (x - y) \<bullet> rot (a - b) = 0
[PROOF STEP]
from that
[PROOF STATE]
proof (chain)
picking this:
x \<in> {a--b}
y \<in> {a--b}
[PROOF STEP]
obtain v where y: "y = a + v *\<^sub>R (b - a)" "0 \<le> v" "v \<le> 1"
[PROOF STATE]
proof (prove)
using this:
x \<in> {a--b}
y \<in> {a--b}

goal (1 subgoal):
 1. (\<And>v. \<lbrakk>y = a + v *\<^sub>R (b - a); 0 \<le> v; v \<le> 1\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (auto simp: in_segment algebra_simps)
[PROOF STATE]
proof (state)
this:
y = a + v *\<^sub>R (b - a)
0 \<le> v
v \<le> 1

goal (1 subgoal):
 1. (x - y) \<bullet> rot (a - b) = 0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x - y) \<bullet> rot (a - b) = 0
[PROOF STEP]
unfolding x y
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (a + u *\<^sub>R (b - a) - (a + v *\<^sub>R (b - a))) \<bullet> rot (a - b) = 0
[PROOF STEP]
apply (auto simp: inner_add_left )
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (u *\<^sub>R (b - a) - v *\<^sub>R (b - a)) \<bullet> rot (a - b) = 0
[PROOF STEP]
by (smt add_diff_cancel_left' in_segment_inner_rot inner_diff_left minus_diff_eq nrm_reverse that(1) that(2) x(1) y(1))
[PROOF STATE]
proof (state)
this:
(x - y) \<bullet> rot (a - b) = 0

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma llength_ldrop: "llength (ldrop n xs) = (if n = \<infinity> then 0 else llength xs - n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. llength (ldrop n xs) = (if n = \<infinity> then 0 else llength xs - n)
[PROOF STEP]
proof(induct xs arbitrary: n)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. ccpo.admissible lSup (\<sqsubseteq>) (\<lambda>a. \<forall>x. llength (ldrop x a) = (if x = \<infinity> then 0 else llength a - x))
 2. \<And>n. llength (ldrop n LNil) = (if n = \<infinity> then 0 else llength LNil - n)
 3. \<And>x xs n. \<lbrakk>lfinite xs; \<And>n. llength (ldrop n xs) = (if n = \<infinity> then 0 else llength xs - n)\<rbrakk> \<Longrightarrow> llength (ldrop n (LCons x xs)) = (if n = \<infinity> then 0 else llength (LCons x xs) - n)
[PROOF STEP]
case (LCons x xs)
[PROOF STATE]
proof (state)
this:
lfinite xs
llength (ldrop ?n xs) = (if ?n = \<infinity> then 0 else llength xs - ?n)

goal (3 subgoals):
 1. ccpo.admissible lSup (\<sqsubseteq>) (\<lambda>a. \<forall>x. llength (ldrop x a) = (if x = \<infinity> then 0 else llength a - x))
 2. \<And>n. llength (ldrop n LNil) = (if n = \<infinity> then 0 else llength LNil - n)
 3. \<And>x xs n. \<lbrakk>lfinite xs; \<And>n. llength (ldrop n xs) = (if n = \<infinity> then 0 else llength xs - n)\<rbrakk> \<Longrightarrow> llength (ldrop n (LCons x xs)) = (if n = \<infinity> then 0 else llength (LCons x xs) - n)
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
lfinite xs
llength (ldrop ?n xs) = (if ?n = \<infinity> then 0 else llength xs - ?n)

goal (1 subgoal):
 1. llength (ldrop n (LCons x xs)) = (if n = \<infinity> then 0 else llength (LCons x xs) - n)
[PROOF STEP]
by simp(cases n rule: co.enat.exhaust, simp_all)
[PROOF STATE]
proof (state)
this:
llength (ldrop n (LCons x xs)) = (if n = \<infinity> then 0 else llength (LCons x xs) - n)

goal (2 subgoals):
 1. ccpo.admissible lSup (\<sqsubseteq>) (\<lambda>a. \<forall>x. llength (ldrop x a) = (if x = \<infinity> then 0 else llength a - x))
 2. \<And>n. llength (ldrop n LNil) = (if n = \<infinity> then 0 else llength LNil - n)
[PROOF STEP]
qed simp_all


[STATEMENT]
lemma pair_measure_countable:
  assumes "countable S1" "countable S2"
  shows "count_space S1 \<Otimes>\<^sub>M count_space S2 = count_space (S1 \<times> S2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. count_space S1 \<Otimes>\<^sub>M count_space S2 = count_space (S1 \<times> S2)
[PROOF STEP]
proof (rule pair_measure_eqI)
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. sigma_finite_measure (count_space S1)
 2. sigma_finite_measure (count_space S2)
 3. sets (count_space S1 \<Otimes>\<^sub>M count_space S2) = sets (count_space (S1 \<times> S2))
 4. \<And>A B. \<lbrakk>A \<in> sets (count_space S1); B \<in> sets (count_space S2)\<rbrakk> \<Longrightarrow> emeasure (count_space S1) A * emeasure (count_space S2) B = emeasure (count_space (S1 \<times> S2)) (A \<times> B)
[PROOF STEP]
show "sigma_finite_measure (count_space S1)" "sigma_finite_measure (count_space S2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sigma_finite_measure (count_space S1) &&& sigma_finite_measure (count_space S2)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
countable S1
countable S2

goal (1 subgoal):
 1. sigma_finite_measure (count_space S1) &&& sigma_finite_measure (count_space S2)
[PROOF STEP]
by (auto intro!: sigma_finite_measure_count_space_countable)
[PROOF STATE]
proof (state)
this:
sigma_finite_measure (count_space S1)
sigma_finite_measure (count_space S2)

goal (2 subgoals):
 1. sets (count_space S1 \<Otimes>\<^sub>M count_space S2) = sets (count_space (S1 \<times> S2))
 2. \<And>A B. \<lbrakk>A \<in> sets (count_space S1); B \<in> sets (count_space S2)\<rbrakk> \<Longrightarrow> emeasure (count_space S1) A * emeasure (count_space S2) B = emeasure (count_space (S1 \<times> S2)) (A \<times> B)
[PROOF STEP]
show "sets (count_space S1 \<Otimes>\<^sub>M count_space S2) = sets (count_space (S1 \<times> S2))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sets (count_space S1 \<Otimes>\<^sub>M count_space S2) = sets (count_space (S1 \<times> S2))
[PROOF STEP]
by (subst sets_pair_countable[OF assms]) auto
[PROOF STATE]
proof (state)
this:
sets (count_space S1 \<Otimes>\<^sub>M count_space S2) = sets (count_space (S1 \<times> S2))

goal (1 subgoal):
 1. \<And>A B. \<lbrakk>A \<in> sets (count_space S1); B \<in> sets (count_space S2)\<rbrakk> \<Longrightarrow> emeasure (count_space S1) A * emeasure (count_space S2) B = emeasure (count_space (S1 \<times> S2)) (A \<times> B)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>A B. \<lbrakk>A \<in> sets (count_space S1); B \<in> sets (count_space S2)\<rbrakk> \<Longrightarrow> emeasure (count_space S1) A * emeasure (count_space S2) B = emeasure (count_space (S1 \<times> S2)) (A \<times> B)
[PROOF STEP]
fix A B
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>A B. \<lbrakk>A \<in> sets (count_space S1); B \<in> sets (count_space S2)\<rbrakk> \<Longrightarrow> emeasure (count_space S1) A * emeasure (count_space S2) B = emeasure (count_space (S1 \<times> S2)) (A \<times> B)
[PROOF STEP]
assume "A \<in> sets (count_space S1)" "B \<in> sets (count_space S2)"
[PROOF STATE]
proof (state)
this:
A \<in> sets (count_space S1)
B \<in> sets (count_space S2)

goal (1 subgoal):
 1. \<And>A B. \<lbrakk>A \<in> sets (count_space S1); B \<in> sets (count_space S2)\<rbrakk> \<Longrightarrow> emeasure (count_space S1) A * emeasure (count_space S2) B = emeasure (count_space (S1 \<times> S2)) (A \<times> B)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
A \<in> sets (count_space S1)
B \<in> sets (count_space S2)
[PROOF STEP]
show "emeasure (count_space S1) A * emeasure (count_space S2) B =
    emeasure (count_space (S1 \<times> S2)) (A \<times> B)"
[PROOF STATE]
proof (prove)
using this:
A \<in> sets (count_space S1)
B \<in> sets (count_space S2)

goal (1 subgoal):
 1. emeasure (count_space S1) A * emeasure (count_space S2) B = emeasure (count_space (S1 \<times> S2)) (A \<times> B)
[PROOF STEP]
by (subst (1 2 3) emeasure_count_space) (auto simp: finite_cartesian_product_iff ennreal_mult_top ennreal_top_mult)
[PROOF STATE]
proof (state)
this:
emeasure (count_space S1) A * emeasure (count_space S2) B = emeasure (count_space (S1 \<times> S2)) (A \<times> B)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma elementLevelLeqCurrentLevel:
  shows "elementLevel a M \<le> currentLevel M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. elementLevel a M \<le> currentLevel M
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. elementLevel a M \<le> currentLevel M
[PROOF STEP]
have "isPrefix (prefixToElement a M) M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. isPrefix (prefixToElement a M) M
[PROOF STEP]
using isPrefixPrefixToElement[of "a" "M"]
[PROOF STATE]
proof (prove)
using this:
isPrefix (prefixToElement a M) M

goal (1 subgoal):
 1. isPrefix (prefixToElement a M) M
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
isPrefix (prefixToElement a M) M

goal (1 subgoal):
 1. elementLevel a M \<le> currentLevel M
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
isPrefix (prefixToElement a M) M
[PROOF STEP]
obtain s
    where "prefixToElement a M @ s = M"
[PROOF STATE]
proof (prove)
using this:
isPrefix (prefixToElement a M) M

goal (1 subgoal):
 1. (\<And>s. prefixToElement a M @ s = M \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding isPrefix_def
[PROOF STATE]
proof (prove)
using this:
\<exists>s. prefixToElement a M @ s = M

goal (1 subgoal):
 1. (\<And>s. prefixToElement a M @ s = M \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
prefixToElement a M @ s = M

goal (1 subgoal):
 1. elementLevel a M \<le> currentLevel M
[PROOF STEP]
hence "M = prefixToElement a M @ s"
[PROOF STATE]
proof (prove)
using this:
prefixToElement a M @ s = M

goal (1 subgoal):
 1. M = prefixToElement a M @ s
[PROOF STEP]
by (rule sym)
[PROOF STATE]
proof (state)
this:
M = prefixToElement a M @ s

goal (1 subgoal):
 1. elementLevel a M \<le> currentLevel M
[PROOF STEP]
hence "currentLevel M = currentLevel (prefixToElement a M @ s)"
[PROOF STATE]
proof (prove)
using this:
M = prefixToElement a M @ s

goal (1 subgoal):
 1. currentLevel M = currentLevel (prefixToElement a M @ s)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
currentLevel M = currentLevel (prefixToElement a M @ s)

goal (1 subgoal):
 1. elementLevel a M \<le> currentLevel M
[PROOF STEP]
hence "currentLevel M = length (markedElements (prefixToElement a M)) + length (markedElements s)"
[PROOF STATE]
proof (prove)
using this:
currentLevel M = currentLevel (prefixToElement a M @ s)

goal (1 subgoal):
 1. currentLevel M = length (markedElements (prefixToElement a M)) + length (markedElements s)
[PROOF STEP]
unfolding currentLevel_def
[PROOF STATE]
proof (prove)
using this:
length (markedElements M) = length (markedElements (prefixToElement a M @ s))

goal (1 subgoal):
 1. length (markedElements M) = length (markedElements (prefixToElement a M)) + length (markedElements s)
[PROOF STEP]
by (simp add: markedElementsAppend)
[PROOF STATE]
proof (state)
this:
currentLevel M = length (markedElements (prefixToElement a M)) + length (markedElements s)

goal (1 subgoal):
 1. elementLevel a M \<le> currentLevel M
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
currentLevel M = length (markedElements (prefixToElement a M)) + length (markedElements s)

goal (1 subgoal):
 1. elementLevel a M \<le> currentLevel M
[PROOF STEP]
unfolding elementLevel_def
[PROOF STATE]
proof (prove)
using this:
currentLevel M = length (markedElements (prefixToElement a M)) + length (markedElements s)

goal (1 subgoal):
 1. length (markedElementsTo a M) \<le> currentLevel M
[PROOF STEP]
unfolding markedElementsTo_def
[PROOF STATE]
proof (prove)
using this:
currentLevel M = length (markedElements (prefixToElement a M)) + length (markedElements s)

goal (1 subgoal):
 1. length (markedElements (prefixToElement a M)) \<le> currentLevel M
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
elementLevel a M \<le> currentLevel M

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma cross7_eq_0: "x \<times>\<^sub>7 y = 0 \<longleftrightarrow> collinear {0, x, y}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x \<times>\<^sub>7 y = 0) = collinear {0, x, y}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (x \<times>\<^sub>7 y = 0) = collinear {0, x, y}
[PROOF STEP]
have "x \<times>\<^sub>7 y = 0 \<longleftrightarrow> norm (x \<times>\<^sub>7 y) = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x \<times>\<^sub>7 y = 0) = (norm (x \<times>\<^sub>7 y) = 0)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(x \<times>\<^sub>7 y = 0) = (norm (x \<times>\<^sub>7 y) = 0)

goal (1 subgoal):
 1. (x \<times>\<^sub>7 y = 0) = collinear {0, x, y}
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(x \<times>\<^sub>7 y = 0) = (norm (x \<times>\<^sub>7 y) = 0)

goal (1 subgoal):
 1. (x \<times>\<^sub>7 y = 0) = collinear {0, x, y}
[PROOF STEP]
have "... \<longleftrightarrow> (norm x * norm y)\<^sup>2 = (x \<bullet> y)\<^sup>2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (norm (x \<times>\<^sub>7 y) = 0) = ((norm x * norm y)\<^sup>2 = (x \<bullet> y)\<^sup>2)
[PROOF STEP]
using norm_cross7_dot_magnitude [of x y]
[PROOF STATE]
proof (prove)
using this:
(norm (x \<times>\<^sub>7 y))\<^sup>2 = (norm x)\<^sup>2 * (norm y)\<^sup>2 - (x \<bullet> y)\<^sup>2

goal (1 subgoal):
 1. (norm (x \<times>\<^sub>7 y) = 0) = ((norm x * norm y)\<^sup>2 = (x \<bullet> y)\<^sup>2)
[PROOF STEP]
by (auto simp: power_mult_distrib)
[PROOF STATE]
proof (state)
this:
(norm (x \<times>\<^sub>7 y) = 0) = ((norm x * norm y)\<^sup>2 = (x \<bullet> y)\<^sup>2)

goal (1 subgoal):
 1. (x \<times>\<^sub>7 y = 0) = collinear {0, x, y}
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(norm (x \<times>\<^sub>7 y) = 0) = ((norm x * norm y)\<^sup>2 = (x \<bullet> y)\<^sup>2)

goal (1 subgoal):
 1. (x \<times>\<^sub>7 y = 0) = collinear {0, x, y}
[PROOF STEP]
have "... \<longleftrightarrow> \<bar>x \<bullet> y\<bar> = norm x * norm y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((norm x * norm y)\<^sup>2 = (x \<bullet> y)\<^sup>2) = (\<bar>x \<bullet> y\<bar> = norm x * norm y)
[PROOF STEP]
using power2_eq_iff
[PROOF STATE]
proof (prove)
using this:
(?x\<^sup>2 = ?y\<^sup>2) = (?x = ?y \<or> ?x = - ?y)

goal (1 subgoal):
 1. ((norm x * norm y)\<^sup>2 = (x \<bullet> y)\<^sup>2) = (\<bar>x \<bullet> y\<bar> = norm x * norm y)
[PROOF STEP]
by (metis (mono_tags, opaque_lifting) abs_minus abs_norm_cancel
              abs_power2 norm_mult power_abs real_norm_def)
[PROOF STATE]
proof (state)
this:
((norm x * norm y)\<^sup>2 = (x \<bullet> y)\<^sup>2) = (\<bar>x \<bullet> y\<bar> = norm x * norm y)

goal (1 subgoal):
 1. (x \<times>\<^sub>7 y = 0) = collinear {0, x, y}
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
((norm x * norm y)\<^sup>2 = (x \<bullet> y)\<^sup>2) = (\<bar>x \<bullet> y\<bar> = norm x * norm y)

goal (1 subgoal):
 1. (x \<times>\<^sub>7 y = 0) = collinear {0, x, y}
[PROOF STEP]
have "... \<longleftrightarrow> collinear {0, x, y}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<bar>x \<bullet> y\<bar> = norm x * norm y) = collinear {0, x, y}
[PROOF STEP]
by (rule norm_cauchy_schwarz_equal)
[PROOF STATE]
proof (state)
this:
(\<bar>x \<bullet> y\<bar> = norm x * norm y) = collinear {0, x, y}

goal (1 subgoal):
 1. (x \<times>\<^sub>7 y = 0) = collinear {0, x, y}
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(x \<times>\<^sub>7 y = 0) = collinear {0, x, y}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(x \<times>\<^sub>7 y = 0) = collinear {0, x, y}

goal (1 subgoal):
 1. (x \<times>\<^sub>7 y = 0) = collinear {0, x, y}
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
(x \<times>\<^sub>7 y = 0) = collinear {0, x, y}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma lincomb_Cons_0_imp_in_Span :
  "\<lbrakk> v \<in> V; set vs \<subseteq> V; a \<noteq> 0; (a#as) \<bullet>\<cdot> (v#vs) = 0 \<rbrakk> \<Longrightarrow> v \<in> Span vs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>v \<in> V; set vs \<subseteq> V; a \<noteq> (0::'f); (a # as) \<bullet>\<cdot> (v # vs) = (0::'v)\<rbrakk> \<Longrightarrow> v \<in> RSpan vs
[PROOF STEP]
using lincomb_Cons eq_neg_iff_add_eq_0[of "a \<cdot> v" "as \<bullet>\<cdot> vs"]
        neg_lincomb smult_assoc[of "1/a" a v] smult_lincomb SpanD_lincomb_arb_len_coeffs
[PROOF STATE]
proof (prove)
using this:
(?r # ?rs) \<bullet>\<cdot> (?m # ?ms) = ?r \<cdot> ?m + ?rs \<bullet>\<cdot> ?ms
(a \<cdot> v = - (as \<bullet>\<cdot> vs)) = (a \<cdot> v + as \<bullet>\<cdot> vs = (0::'v))
\<lbrakk>set ?rs \<subseteq> UNIV; set ?ms \<subseteq> V\<rbrakk> \<Longrightarrow> - (?rs \<bullet>\<cdot> ?ms) = map uminus ?rs \<bullet>\<cdot> ?ms
\<lbrakk>(1::'f) / a \<in> UNIV; a \<in> UNIV; v \<in> V\<rbrakk> \<Longrightarrow> ((1::'f) / a) \<cdot> a \<cdot> v = ((1::'f) / a * a) \<cdot> v
\<lbrakk>set ?rs \<subseteq> UNIV; ?s \<in> UNIV; set ?ms \<subseteq> V\<rbrakk> \<Longrightarrow> ?s \<cdot> ?rs \<bullet>\<cdot> ?ms = map ((*) ?s) ?rs \<bullet>\<cdot> ?ms
set ?ms \<subseteq> V \<Longrightarrow> RSpan ?ms = {rs \<bullet>\<cdot> ?ms |rs. set rs \<subseteq> UNIV}

goal (1 subgoal):
 1. \<lbrakk>v \<in> V; set vs \<subseteq> V; a \<noteq> (0::'f); (a # as) \<bullet>\<cdot> (v # vs) = (0::'v)\<rbrakk> \<Longrightarrow> v \<in> RSpan vs
[PROOF STEP]
by    auto


[STATEMENT]
lemma min_product_comm:
  "A \<otimes>\<^sub>m B = B \<otimes>\<^sub>m A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A \<otimes>\<^sub>m B = B \<otimes>\<^sub>m A
[PROOF STEP]
unfolding min_product_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. min_set (A \<otimes> B) = min_set (B \<otimes> A)
[PROOF STEP]
by (simp add: product_comm)


[STATEMENT]
lemma degree_of_difference_diff_degree:
  assumes "p \<in> carrier P"
  assumes "q \<in> carrier P"
  assumes "degree q < degree p"
  shows "degree (p \<ominus>\<^bsub>P\<^esub> q) = degree p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. deg R (p \<ominus>\<^bsub>P\<^esub> q) = deg R p
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. deg R (p \<ominus>\<^bsub>P\<^esub> q) = deg R p
[PROOF STEP]
have A: "(p \<ominus>\<^bsub>P\<^esub> q) = p \<oplus>\<^bsub>P\<^esub> (\<ominus>\<^bsub>P\<^esub> q)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. p \<ominus>\<^bsub>P\<^esub> q = p \<oplus>\<^bsub>P\<^esub> \<ominus>\<^bsub>P\<^esub> q
[PROOF STEP]
by (simp add: P.minus_eq)
[PROOF STATE]
proof (state)
this:
p \<ominus>\<^bsub>P\<^esub> q = p \<oplus>\<^bsub>P\<^esub> \<ominus>\<^bsub>P\<^esub> q

goal (1 subgoal):
 1. deg R (p \<ominus>\<^bsub>P\<^esub> q) = deg R p
[PROOF STEP]
have "degree (\<ominus>\<^bsub>P\<^esub> q) = degree q "
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. deg R (\<ominus>\<^bsub>P\<^esub> q) = deg R q
[PROOF STEP]
by (simp add: assms(2))
[PROOF STATE]
proof (state)
this:
deg R (\<ominus>\<^bsub>P\<^esub> q) = deg R q

goal (1 subgoal):
 1. deg R (p \<ominus>\<^bsub>P\<^esub> q) = deg R p
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
deg R (\<ominus>\<^bsub>P\<^esub> q) = deg R q
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
deg R (\<ominus>\<^bsub>P\<^esub> q) = deg R q

goal (1 subgoal):
 1. deg R (p \<ominus>\<^bsub>P\<^esub> q) = deg R p
[PROOF STEP]
using assms A
[PROOF STATE]
proof (prove)
using this:
deg R (\<ominus>\<^bsub>P\<^esub> q) = deg R q
p \<in> carrier P
q \<in> carrier P
deg R q < deg R p
p \<ominus>\<^bsub>P\<^esub> q = p \<oplus>\<^bsub>P\<^esub> \<ominus>\<^bsub>P\<^esub> q

goal (1 subgoal):
 1. deg R (p \<ominus>\<^bsub>P\<^esub> q) = deg R p
[PROOF STEP]
by (simp add: degree_of_sum_diff_degree)
[PROOF STATE]
proof (state)
this:
deg R (p \<ominus>\<^bsub>P\<^esub> q) = deg R p

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma (in ring_hom_ring) non_trivial_field_hom_imp_inj:
  assumes "field R"
  shows "h ` (carrier R) \<noteq> { \<zero>\<^bsub>S\<^esub> } \<Longrightarrow> inj_on h (carrier R)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. h ` carrier R \<noteq> {\<zero>\<^bsub>S\<^esub>} \<Longrightarrow> inj_on h (carrier R)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. h ` carrier R \<noteq> {\<zero>\<^bsub>S\<^esub>} \<Longrightarrow> inj_on h (carrier R)
[PROOF STEP]
assume "h ` (carrier R) \<noteq> { \<zero>\<^bsub>S\<^esub> }"
[PROOF STATE]
proof (state)
this:
h ` carrier R \<noteq> {\<zero>\<^bsub>S\<^esub>}

goal (1 subgoal):
 1. h ` carrier R \<noteq> {\<zero>\<^bsub>S\<^esub>} \<Longrightarrow> inj_on h (carrier R)
[PROOF STEP]
hence "a_kernel R S h \<noteq> carrier R"
[PROOF STATE]
proof (prove)
using this:
h ` carrier R \<noteq> {\<zero>\<^bsub>S\<^esub>}

goal (1 subgoal):
 1. a_kernel R S h \<noteq> carrier R
[PROOF STEP]
using trivial_hom_iff
[PROOF STATE]
proof (prove)
using this:
h ` carrier R \<noteq> {\<zero>\<^bsub>S\<^esub>}
(h ` carrier R = {\<zero>\<^bsub>S\<^esub>}) = (a_kernel R S h = carrier R)

goal (1 subgoal):
 1. a_kernel R S h \<noteq> carrier R
[PROOF STEP]
by linarith
[PROOF STATE]
proof (state)
this:
a_kernel R S h \<noteq> carrier R

goal (1 subgoal):
 1. h ` carrier R \<noteq> {\<zero>\<^bsub>S\<^esub>} \<Longrightarrow> inj_on h (carrier R)
[PROOF STEP]
hence "a_kernel R S h = { \<zero> }"
[PROOF STATE]
proof (prove)
using this:
a_kernel R S h \<noteq> carrier R

goal (1 subgoal):
 1. a_kernel R S h = {\<zero>}
[PROOF STEP]
using field.all_ideals[OF assms] kernel_is_ideal
[PROOF STATE]
proof (prove)
using this:
a_kernel R S h \<noteq> carrier R
{I. ideal I R} = {{\<zero>}, carrier R}
ideal (a_kernel R S h) R

goal (1 subgoal):
 1. a_kernel R S h = {\<zero>}
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
a_kernel R S h = {\<zero>}

goal (1 subgoal):
 1. h ` carrier R \<noteq> {\<zero>\<^bsub>S\<^esub>} \<Longrightarrow> inj_on h (carrier R)
[PROOF STEP]
thus "inj_on h (carrier R)"
[PROOF STATE]
proof (prove)
using this:
a_kernel R S h = {\<zero>}

goal (1 subgoal):
 1. inj_on h (carrier R)
[PROOF STEP]
using trivial_ker_imp_inj
[PROOF STATE]
proof (prove)
using this:
a_kernel R S h = {\<zero>}
a_kernel R S h = {\<zero>} \<Longrightarrow> inj_on h (carrier R)

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma ceiling_of_nat [simp]: "\<lceil>of_nat n\<rceil> = int n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lceil>of_nat n\<rceil> = int n
[PROOF STEP]
using ceiling_of_int [of "of_nat n"]
[PROOF STATE]
proof (prove)
using this:
\<lceil>of_int (int n)\<rceil> = int n

goal (1 subgoal):
 1. \<lceil>of_nat n\<rceil> = int n
[PROOF STEP]
by simp


[STATEMENT]
lemma scalar_mult_singleton[simp]: "scalar_mult y (singleton_matrix j i x) = singleton_matrix j i (y * x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. scalar_mult y (singleton_matrix j i x) = singleton_matrix j i (y * x)
[PROOF STEP]
apply (subst Rep_matrix_inject[symmetric])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Rep_matrix (scalar_mult y (singleton_matrix j i x)) = Rep_matrix (singleton_matrix j i (y * x))
[PROOF STEP]
apply (rule ext)+
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>xa xaa. Rep_matrix (scalar_mult y (singleton_matrix j i x)) xa xaa = Rep_matrix (singleton_matrix j i (y * x)) xa xaa
[PROOF STEP]
apply (auto)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma split_vars_num_holes: "num_holes (fst (split_vars t)) = length (snd (split_vars t))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. num_holes (fst (split_vars t)) = length (snd (split_vars t))
[PROOF STEP]
proof (induct t)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>x. num_holes (fst (split_vars (Var x))) = length (snd (split_vars (Var x)))
 2. \<And>x1a x2. (\<And>x2a. x2a \<in> set x2 \<Longrightarrow> num_holes (fst (split_vars x2a)) = length (snd (split_vars x2a))) \<Longrightarrow> num_holes (fst (split_vars (Fun x1a x2))) = length (snd (split_vars (Fun x1a x2)))
[PROOF STEP]
case (Fun f ts)
[PROOF STATE]
proof (state)
this:
?x2a \<in> set ts \<Longrightarrow> num_holes (fst (split_vars ?x2a)) = length (snd (split_vars ?x2a))

goal (2 subgoals):
 1. \<And>x. num_holes (fst (split_vars (Var x))) = length (snd (split_vars (Var x)))
 2. \<And>x1a x2. (\<And>x2a. x2a \<in> set x2 \<Longrightarrow> num_holes (fst (split_vars x2a)) = length (snd (split_vars x2a))) \<Longrightarrow> num_holes (fst (split_vars (Fun x1a x2))) = length (snd (split_vars (Fun x1a x2)))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
?x2a \<in> set ts \<Longrightarrow> num_holes (fst (split_vars ?x2a)) = length (snd (split_vars ?x2a))
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
?x2a \<in> set ts \<Longrightarrow> num_holes (fst (split_vars ?x2a)) = length (snd (split_vars ?x2a))

goal (1 subgoal):
 1. num_holes (fst (split_vars (Fun f ts))) = length (snd (split_vars (Fun f ts)))
[PROOF STEP]
by (induct ts, auto)
[PROOF STATE]
proof (state)
this:
num_holes (fst (split_vars (Fun f ts))) = length (snd (split_vars (Fun f ts)))

goal (1 subgoal):
 1. \<And>x. num_holes (fst (split_vars (Var x))) = length (snd (split_vars (Var x)))
[PROOF STEP]
qed simp


[STATEMENT]
lemma inv\<^sub>L_I:
  assumes "f o\<^sub>L g = id_blinfun" "g o\<^sub>L f = id_blinfun"
  shows "g = inv\<^sub>L f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. g = inv\<^sub>L f
[PROOF STEP]
using assms inv\<^sub>L_eq
[PROOF STATE]
proof (prove)
using this:
f o\<^sub>L g = id_blinfun
g o\<^sub>L f = id_blinfun
is_inverse\<^sub>L ?f ?g \<Longrightarrow> inv\<^sub>L ?f = ?g

goal (1 subgoal):
 1. g = inv\<^sub>L f
[PROOF STEP]
unfolding is_inverse\<^sub>L_def
[PROOF STATE]
proof (prove)
using this:
f o\<^sub>L g = id_blinfun
g o\<^sub>L f = id_blinfun
?f o\<^sub>L ?g = id_blinfun \<and> ?g o\<^sub>L ?f = id_blinfun \<Longrightarrow> inv\<^sub>L ?f = ?g

goal (1 subgoal):
 1. g = inv\<^sub>L f
[PROOF STEP]
by auto


[STATEMENT]
lemma powr_less_mono2: "0 < a \<Longrightarrow> 0 \<le> x \<Longrightarrow> x < y \<Longrightarrow> x powr a < y powr a"
  for x :: real
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 < a; 0 \<le> x; x < y\<rbrakk> \<Longrightarrow> x powr a < y powr a
[PROOF STEP]
by (simp add: powr_def)


[STATEMENT]
lemma eq_sqrt_squared:
  "(x::real) \<ge> 0 \<Longrightarrow> (sqrt x) * (sqrt x) = x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> x \<Longrightarrow> sqrt x * sqrt x = x
[PROOF STEP]
by (metis abs_of_nonneg real_sqrt_abs2 real_sqrt_mult)


[STATEMENT]
lemma frechet_derivative_snd:
  "frechet_derivative (\<lambda>x. snd (f x)) (at x) = (\<lambda>xa. snd (frechet_derivative f (at x) xa))"
  if "(f differentiable at x)"
  for f::"_\<Rightarrow>(_::real_normed_vector \<times> _::real_normed_vector)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. frechet_derivative (\<lambda>x. snd (f x)) (at x) = (\<lambda>xa. snd (frechet_derivative f (at x) xa))
[PROOF STEP]
apply (rule frechet_derivative_at')
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. snd (f x)) has_derivative (\<lambda>xa. snd (frechet_derivative f (at x) xa))) (at x)
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
f differentiable at x

goal (1 subgoal):
 1. ((\<lambda>x. snd (f x)) has_derivative (\<lambda>xa. snd (frechet_derivative f (at x) xa))) (at x)
[PROOF STEP]
by (auto intro!: derivative_eq_intros frechet_derivative_worksI)


[STATEMENT]
lemma lastTrailElementMarkedImpliesMarkedElementsToLastElementAreAllMarkedElements:
  assumes
  "marked (last M)" and "last (elements M) \<notin> set (butlast (elements M))"
  shows
  "markedElementsTo (last (elements M)) M = markedElements M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. markedElementsTo (last (elements M)) M = markedElements M
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
marked (last M)
last (elements M) \<notin> set (butlast (elements M))

goal (1 subgoal):
 1. markedElementsTo (last (elements M)) M = markedElements M
[PROOF STEP]
unfolding markedElementsTo_def
[PROOF STATE]
proof (prove)
using this:
marked (last M)
last (elements M) \<notin> set (butlast (elements M))

goal (1 subgoal):
 1. markedElements (prefixToElement (last (elements M)) M) = markedElements M
[PROOF STEP]
by (induct M) auto


[STATEMENT]
lemma GS_inv_rec: "GS_inv d v = r_vec d + l *\<^sub>R (P_upper d *v v + P_lower d *v (GS_inv d v))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. GS_inv d v = r_vec d + l *\<^sub>R (P_upper d *v v + P_lower d *v GS_inv d v)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. GS_inv d v = r_vec d + l *\<^sub>R (P_upper d *v v + P_lower d *v GS_inv d v)
[PROOF STEP]
have "Q_mat d *v (GS_inv d v) = r_vec d + R_mat d *v v"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Q_mat d *v GS_inv d v = r_vec d + R_mat d *v v
[PROOF STEP]
using splitting_gauss[of d] blinfun_to_matrix_inverse(1)
[PROOF STATE]
proof (prove)
using this:
is_splitting_blin (id_blinfun - l *\<^sub>R \<P>\<^sub>1 (mk_dec_det d)) (Q_GS d) (R_GS d)
invertible\<^sub>L ?X \<Longrightarrow> invertible (blinfun_to_matrix ?X)

goal (1 subgoal):
 1. Q_mat d *v GS_inv d v = r_vec d + R_mat d *v v
[PROOF STEP]
unfolding GS_inv_def matrix_vector_mul_assoc is_splitting_blin_def'
[PROOF STATE]
proof (prove)
using this:
id_blinfun - l *\<^sub>R \<P>\<^sub>1 (mk_dec_det d) = Q_GS d - R_GS d \<and> invertible\<^sub>L (Q_GS d) \<and> nonneg_blinfun (inv\<^sub>L (Q_GS d)) \<and> nonneg_blinfun (R_GS d)
invertible\<^sub>L ?X \<Longrightarrow> invertible (blinfun_to_matrix ?X)

goal (1 subgoal):
 1. Q_mat d ** matrix_inv (Q_mat d) *v (r_vec d + R_mat d *v v) = r_vec d + R_mat d *v v
[PROOF STEP]
by (subst matrix_inv(2)) auto
[PROOF STATE]
proof (state)
this:
Q_mat d *v GS_inv d v = r_vec d + R_mat d *v v

goal (1 subgoal):
 1. GS_inv d v = r_vec d + l *\<^sub>R (P_upper d *v v + P_lower d *v GS_inv d v)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
Q_mat d *v GS_inv d v = r_vec d + R_mat d *v v

goal (1 subgoal):
 1. GS_inv d v = r_vec d + l *\<^sub>R (P_upper d *v v + P_lower d *v GS_inv d v)
[PROOF STEP]
unfolding Q_mat_def R_mat_def
[PROOF STATE]
proof (prove)
using this:
(mat 1 - l *\<^sub>R P_lower d) *v GS_inv d v = r_vec d + l *\<^sub>R P_upper d *v v

goal (1 subgoal):
 1. GS_inv d v = r_vec d + l *\<^sub>R (P_upper d *v v + P_lower d *v GS_inv d v)
[PROOF STEP]
by (auto simp: algebra_simps scaleR_matrix_vector_assoc)
[PROOF STATE]
proof (state)
this:
GS_inv d v = r_vec d + l *\<^sub>R (P_upper d *v v + P_lower d *v GS_inv d v)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma interval_of_zero: "interval_of 0 = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. interval_of (0::'a) = 0
[PROOF STEP]
by (simp add: interval_eqI)


[STATEMENT]
lemma homeomorphic_maps_subtopologies_alt:
     "\<lbrakk>homeomorphic_maps X Y f g; f ` (topspace X \<inter> S) \<subseteq> T; g ` (topspace Y \<inter> T) \<subseteq> S\<rbrakk>
      \<Longrightarrow> homeomorphic_maps (subtopology X S) (subtopology Y T) f g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>homeomorphic_maps X Y f g; f ` (topspace X \<inter> S) \<subseteq> T; g ` (topspace Y \<inter> T) \<subseteq> S\<rbrakk> \<Longrightarrow> homeomorphic_maps (subtopology X S) (subtopology Y T) f g
[PROOF STEP]
unfolding homeomorphic_maps_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>continuous_map X Y f \<and> continuous_map Y X g \<and> (\<forall>x\<in>topspace X. g (f x) = x) \<and> (\<forall>y\<in>topspace Y. f (g y) = y); f ` (topspace X \<inter> S) \<subseteq> T; g ` (topspace Y \<inter> T) \<subseteq> S\<rbrakk> \<Longrightarrow> continuous_map (subtopology X S) (subtopology Y T) f \<and> continuous_map (subtopology Y T) (subtopology X S) g \<and> (\<forall>x\<in>topspace (subtopology X S). g (f x) = x) \<and> (\<forall>y\<in>topspace (subtopology Y T). f (g y) = y)
[PROOF STEP]
by (force simp: continuous_map_from_subtopology continuous_map_in_subtopology)


[STATEMENT]
lemma pi_half: "pi/2 = (THE x. 0 \<le> x \<and> x \<le> 2 \<and> cos x = 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pi / 2 = (THE x. 0 \<le> x \<and> x \<le> 2 \<and> cos x = 0)
[PROOF STEP]
by (simp add: pi_def)


[STATEMENT]
lemma rev_concat: "rev (concat xs) = concat (map rev (rev xs))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rev (concat xs) = concat (map rev (rev xs))
[PROOF STEP]
by (induct xs) auto


[STATEMENT]
lemma cadd_le_mono: "\<lbrakk>\<kappa>' \<le> \<kappa>; \<mu>' \<le> \<mu>\<rbrakk> \<Longrightarrow> \<kappa>' \<oplus> \<mu>' \<le> \<kappa> \<oplus> \<mu>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<kappa>' \<le> \<kappa>; \<mu>' \<le> \<mu>\<rbrakk> \<Longrightarrow> \<kappa>' \<oplus> \<mu>' \<le> \<kappa> \<oplus> \<mu>
[PROOF STEP]
unfolding cadd_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<kappa>' \<le> \<kappa>; \<mu>' \<le> \<mu>\<rbrakk> \<Longrightarrow> vcard (\<kappa>' \<Uplus> \<mu>') \<le> vcard (\<kappa> \<Uplus> \<mu>)
[PROOF STEP]
by (metis (no_types) lepoll_imp_Card_le less_eq_V_def subset_imp_lepoll sum_subset_iff)


[STATEMENT]
lemma recurrent_subset_incl:
  "recurrent_subset A \<subseteq> A"
  "recurrent_subset_infty A \<subseteq> A"
  "recurrent_subset_infty A \<subseteq> recurrent_subset A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. recurrent_subset A \<subseteq> A &&& recurrent_subset_infty A \<subseteq> A &&& recurrent_subset_infty A \<subseteq> recurrent_subset A
[PROOF STEP]
unfolding recurrent_subset_def recurrent_subset_infty_def'
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Union>n\<in>{1..}. A \<inter> (T ^^ n) -` A) \<subseteq> A &&& (\<Inter>m. \<Union>n\<in>{m..}. A \<inter> (T ^^ n) -` A) \<subseteq> A &&& (\<Inter>m. \<Union>n\<in>{m..}. A \<inter> (T ^^ n) -` A) \<subseteq> (\<Union>n\<in>{1..}. A \<inter> (T ^^ n) -` A)
[PROOF STEP]
by (simp, simp, fast)


[STATEMENT]
lemma mono_meet: "x \<sqsubseteq> x' \<Longrightarrow> y \<sqsubseteq> y' \<Longrightarrow> x \<sqinter> y \<sqsubseteq> x' \<sqinter> y'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x \<sqsubseteq> x'; y \<sqsubseteq> y'\<rbrakk> \<Longrightarrow> x \<sqinter> y \<sqsubseteq> x' \<sqinter> y'
[PROOF STEP]
by (metis meet_greatest meet_le1 meet_le2 le_trans)


[STATEMENT]
lemma octo_of_real_of_int_eq [simp]: "octo_of_real (of_int z) = octo_of_int z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. octo_of_real (real_of_int z) = octo_of_int z
[PROOF STEP]
unfolding octo_of_real_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real_of_int z *\<^sub>R 1 = octo_of_int z
[PROOF STEP]
by (simp add: octo_of_int_def)


[STATEMENT]
lemma wf_list_graph_iff_wf_graph: "wf_graph (list_graph_to_graph G) \<longleftrightarrow> wf_list_graph_axioms G"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. wf_graph (list_graph_to_graph G) = wf_list_graph_axioms G
[PROOF STEP]
unfolding list_graph_to_graph_def wf_graph_def wf_list_graph_axioms_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((fst ` edges \<lparr>nodes = set (nodesL G), edges = set (edgesL G)\<rparr> \<subseteq> nodes \<lparr>nodes = set (nodesL G), edges = set (edgesL G)\<rparr> \<and> snd ` edges \<lparr>nodes = set (nodesL G), edges = set (edgesL G)\<rparr> \<subseteq> nodes \<lparr>nodes = set (nodesL G), edges = set (edgesL G)\<rparr>) \<and> finite (edges \<lparr>nodes = set (nodesL G), edges = set (edgesL G)\<rparr>) \<and> finite (nodes \<lparr>nodes = set (nodesL G), edges = set (edgesL G)\<rparr>)) = (fst ` set (edgesL G) \<subseteq> set (nodesL G) \<and> snd ` set (edgesL G) \<subseteq> set (nodesL G))
[PROOF STEP]
by simp


[STATEMENT]
lemma star_of_approx_one_iff [simp]: "star_of k \<approx> 1 \<longleftrightarrow> k = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (star_of k \<approx> 1) = (k = (1::'a))
[PROOF STEP]
by (simp_all add: star_of_approx_iff [symmetric])


[STATEMENT]
lemma power_mono_ennreal: "x \<le> y \<Longrightarrow> x ^ n \<le> (y ^ n :: ennreal)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<le> y \<Longrightarrow> x ^ n \<le> y ^ n
[PROOF STEP]
by (induction n) (auto intro!: mult_mono)


[STATEMENT]
lemma expr_typing_cong:
  "(\<And>x. x \<in> free_vars e \<Longrightarrow> \<Gamma> x = \<Gamma>' x) \<Longrightarrow> \<Gamma> \<turnstile> e : t \<longleftrightarrow> \<Gamma>' \<turnstile> e : t"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>x. x \<in> free_vars e \<Longrightarrow> \<Gamma> x = \<Gamma>' x) \<Longrightarrow> (\<Gamma> \<turnstile> e : t) = (\<Gamma>' \<turnstile> e : t)
[PROOF STEP]
by (intro iffI) (simp_all add: expr_typing_cong')


[STATEMENT]
lemma inner_prod_is_sesquilinear:
  fixes u1 u2 v1 v2:: "complex vec" and c1 c2 c3 c4:: complex and n:: nat
  assumes "dim_vec u1 = n" and "dim_vec u2 = n" and "dim_vec v1 = n" and "dim_vec v2 = n"
  shows "\<langle>c1 \<cdot>\<^sub>v u1 + c2 \<cdot>\<^sub>v u2|c3 \<cdot>\<^sub>v v1 + c4 \<cdot>\<^sub>v v2\<rangle> = cnj (c1) * c3 * \<langle>u1|v1\<rangle> + cnj (c2) * c3 * \<langle>u2|v1\<rangle> +
                                                 cnj (c1) * c4 * \<langle>u1|v2\<rangle> + cnj (c2) * c4 * \<langle>u2|v2\<rangle>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<langle>c1 \<cdot>\<^sub>v u1 + c2 \<cdot>\<^sub>v u2|c3 \<cdot>\<^sub>v v1 + c4 \<cdot>\<^sub>v v2\<rangle> = cnj c1 * c3 * \<langle>u1|v1\<rangle> + cnj c2 * c3 * \<langle>u2|v1\<rangle> + cnj c1 * c4 * \<langle>u1|v2\<rangle> + cnj c2 * c4 * \<langle>u2|v2\<rangle>
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<langle>c1 \<cdot>\<^sub>v u1 + c2 \<cdot>\<^sub>v u2|c3 \<cdot>\<^sub>v v1 + c4 \<cdot>\<^sub>v v2\<rangle> = cnj c1 * c3 * \<langle>u1|v1\<rangle> + cnj c2 * c3 * \<langle>u2|v1\<rangle> + cnj c1 * c4 * \<langle>u1|v2\<rangle> + cnj c2 * c4 * \<langle>u2|v2\<rangle>
[PROOF STEP]
have "\<langle>c1 \<cdot>\<^sub>v u1 + c2 \<cdot>\<^sub>v u2|c3 \<cdot>\<^sub>v v1 + c4 \<cdot>\<^sub>v v2\<rangle> = c3 * \<langle>c1 \<cdot>\<^sub>v u1 + c2 \<cdot>\<^sub>v u2|v1\<rangle> + c4 * \<langle>c1 \<cdot>\<^sub>v u1 + c2 \<cdot>\<^sub>v u2|v2\<rangle>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<langle>c1 \<cdot>\<^sub>v u1 + c2 \<cdot>\<^sub>v u2|c3 \<cdot>\<^sub>v v1 + c4 \<cdot>\<^sub>v v2\<rangle> = c3 * \<langle>c1 \<cdot>\<^sub>v u1 + c2 \<cdot>\<^sub>v u2|v1\<rangle> + c4 * \<langle>c1 \<cdot>\<^sub>v u1 + c2 \<cdot>\<^sub>v u2|v2\<rangle>
[PROOF STEP]
using inner_prod_is_linear[of "c1 \<cdot>\<^sub>v u1 + c2 \<cdot>\<^sub>v u2" "\<lambda>i. if i = 0 then v1 else v2"
                                  "\<lambda>i. if i = 0 then c3 else c4"] assms
[PROOF STATE]
proof (prove)
using this:
\<forall>i\<in>{0, 1}. dim_vec (c1 \<cdot>\<^sub>v u1 + c2 \<cdot>\<^sub>v u2) = dim_vec (if i = 0 then v1 else v2) \<Longrightarrow> \<langle>c1 \<cdot>\<^sub>v u1 + c2 \<cdot>\<^sub>v u2|(if 0 = 0 then c3 else c4) \<cdot>\<^sub>v (if 0 = 0 then v1 else v2) + (if 1 = 0 then c3 else c4) \<cdot>\<^sub>v (if 1 = 0 then v1 else v2)\<rangle> = (\<Sum>i\<le>1. (if i = 0 then c3 else c4) * \<langle>c1 \<cdot>\<^sub>v u1 + c2 \<cdot>\<^sub>v u2|if i = 0 then v1 else v2\<rangle>)
dim_vec u1 = n
dim_vec u2 = n
dim_vec v1 = n
dim_vec v2 = n

goal (1 subgoal):
 1. \<langle>c1 \<cdot>\<^sub>v u1 + c2 \<cdot>\<^sub>v u2|c3 \<cdot>\<^sub>v v1 + c4 \<cdot>\<^sub>v v2\<rangle> = c3 * \<langle>c1 \<cdot>\<^sub>v u1 + c2 \<cdot>\<^sub>v u2|v1\<rangle> + c4 * \<langle>c1 \<cdot>\<^sub>v u1 + c2 \<cdot>\<^sub>v u2|v2\<rangle>
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<langle>c1 \<cdot>\<^sub>v u1 + c2 \<cdot>\<^sub>v u2|c3 \<cdot>\<^sub>v v1 + c4 \<cdot>\<^sub>v v2\<rangle> = c3 * \<langle>c1 \<cdot>\<^sub>v u1 + c2 \<cdot>\<^sub>v u2|v1\<rangle> + c4 * \<langle>c1 \<cdot>\<^sub>v u1 + c2 \<cdot>\<^sub>v u2|v2\<rangle>

goal (1 subgoal):
 1. \<langle>c1 \<cdot>\<^sub>v u1 + c2 \<cdot>\<^sub>v u2|c3 \<cdot>\<^sub>v v1 + c4 \<cdot>\<^sub>v v2\<rangle> = cnj c1 * c3 * \<langle>u1|v1\<rangle> + cnj c2 * c3 * \<langle>u2|v1\<rangle> + cnj c1 * c4 * \<langle>u1|v2\<rangle> + cnj c2 * c4 * \<langle>u2|v2\<rangle>
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<langle>c1 \<cdot>\<^sub>v u1 + c2 \<cdot>\<^sub>v u2|c3 \<cdot>\<^sub>v v1 + c4 \<cdot>\<^sub>v v2\<rangle> = c3 * \<langle>c1 \<cdot>\<^sub>v u1 + c2 \<cdot>\<^sub>v u2|v1\<rangle> + c4 * \<langle>c1 \<cdot>\<^sub>v u1 + c2 \<cdot>\<^sub>v u2|v2\<rangle>

goal (1 subgoal):
 1. \<langle>c1 \<cdot>\<^sub>v u1 + c2 \<cdot>\<^sub>v u2|c3 \<cdot>\<^sub>v v1 + c4 \<cdot>\<^sub>v v2\<rangle> = cnj c1 * c3 * \<langle>u1|v1\<rangle> + cnj c2 * c3 * \<langle>u2|v1\<rangle> + cnj c1 * c4 * \<langle>u1|v2\<rangle> + cnj c2 * c4 * \<langle>u2|v2\<rangle>
[PROOF STEP]
have "... = c3 * cnj(\<langle>v1|c1 \<cdot>\<^sub>v u1 + c2 \<cdot>\<^sub>v u2\<rangle>) + c4 * cnj(\<langle>v2|c1 \<cdot>\<^sub>v u1 + c2 \<cdot>\<^sub>v u2\<rangle>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. c3 * \<langle>c1 \<cdot>\<^sub>v u1 + c2 \<cdot>\<^sub>v u2|v1\<rangle> + c4 * \<langle>c1 \<cdot>\<^sub>v u1 + c2 \<cdot>\<^sub>v u2|v2\<rangle> = c3 * cnj \<langle>v1|c1 \<cdot>\<^sub>v u1 + c2 \<cdot>\<^sub>v u2\<rangle> + c4 * cnj \<langle>v2|c1 \<cdot>\<^sub>v u1 + c2 \<cdot>\<^sub>v u2\<rangle>
[PROOF STEP]
using assms inner_prod_cnj[of "v1" "c1 \<cdot>\<^sub>v u1 + c2 \<cdot>\<^sub>v u2"] inner_prod_cnj[of "v2" "c1 \<cdot>\<^sub>v u1 + c2 \<cdot>\<^sub>v u2"]
[PROOF STATE]
proof (prove)
using this:
dim_vec u1 = n
dim_vec u2 = n
dim_vec v1 = n
dim_vec v2 = n
dim_vec v1 = dim_vec (c1 \<cdot>\<^sub>v u1 + c2 \<cdot>\<^sub>v u2) \<Longrightarrow> \<langle>c1 \<cdot>\<^sub>v u1 + c2 \<cdot>\<^sub>v u2|v1\<rangle> = cnj \<langle>v1|c1 \<cdot>\<^sub>v u1 + c2 \<cdot>\<^sub>v u2\<rangle>
dim_vec v2 = dim_vec (c1 \<cdot>\<^sub>v u1 + c2 \<cdot>\<^sub>v u2) \<Longrightarrow> \<langle>c1 \<cdot>\<^sub>v u1 + c2 \<cdot>\<^sub>v u2|v2\<rangle> = cnj \<langle>v2|c1 \<cdot>\<^sub>v u1 + c2 \<cdot>\<^sub>v u2\<rangle>

goal (1 subgoal):
 1. c3 * \<langle>c1 \<cdot>\<^sub>v u1 + c2 \<cdot>\<^sub>v u2|v1\<rangle> + c4 * \<langle>c1 \<cdot>\<^sub>v u1 + c2 \<cdot>\<^sub>v u2|v2\<rangle> = c3 * cnj \<langle>v1|c1 \<cdot>\<^sub>v u1 + c2 \<cdot>\<^sub>v u2\<rangle> + c4 * cnj \<langle>v2|c1 \<cdot>\<^sub>v u1 + c2 \<cdot>\<^sub>v u2\<rangle>
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
c3 * \<langle>c1 \<cdot>\<^sub>v u1 + c2 \<cdot>\<^sub>v u2|v1\<rangle> + c4 * \<langle>c1 \<cdot>\<^sub>v u1 + c2 \<cdot>\<^sub>v u2|v2\<rangle> = c3 * cnj \<langle>v1|c1 \<cdot>\<^sub>v u1 + c2 \<cdot>\<^sub>v u2\<rangle> + c4 * cnj \<langle>v2|c1 \<cdot>\<^sub>v u1 + c2 \<cdot>\<^sub>v u2\<rangle>

goal (1 subgoal):
 1. \<langle>c1 \<cdot>\<^sub>v u1 + c2 \<cdot>\<^sub>v u2|c3 \<cdot>\<^sub>v v1 + c4 \<cdot>\<^sub>v v2\<rangle> = cnj c1 * c3 * \<langle>u1|v1\<rangle> + cnj c2 * c3 * \<langle>u2|v1\<rangle> + cnj c1 * c4 * \<langle>u1|v2\<rangle> + cnj c2 * c4 * \<langle>u2|v2\<rangle>
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
c3 * \<langle>c1 \<cdot>\<^sub>v u1 + c2 \<cdot>\<^sub>v u2|v1\<rangle> + c4 * \<langle>c1 \<cdot>\<^sub>v u1 + c2 \<cdot>\<^sub>v u2|v2\<rangle> = c3 * cnj \<langle>v1|c1 \<cdot>\<^sub>v u1 + c2 \<cdot>\<^sub>v u2\<rangle> + c4 * cnj \<langle>v2|c1 \<cdot>\<^sub>v u1 + c2 \<cdot>\<^sub>v u2\<rangle>

goal (1 subgoal):
 1. \<langle>c1 \<cdot>\<^sub>v u1 + c2 \<cdot>\<^sub>v u2|c3 \<cdot>\<^sub>v v1 + c4 \<cdot>\<^sub>v v2\<rangle> = cnj c1 * c3 * \<langle>u1|v1\<rangle> + cnj c2 * c3 * \<langle>u2|v1\<rangle> + cnj c1 * c4 * \<langle>u1|v2\<rangle> + cnj c2 * c4 * \<langle>u2|v2\<rangle>
[PROOF STEP]
have "... = c3 * cnj(c1 * \<langle>v1|u1\<rangle> + c2 * \<langle>v1|u2\<rangle>) + c4 * cnj(c1 * \<langle>v2|u1\<rangle> + c2 * \<langle>v2|u2\<rangle>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. c3 * cnj \<langle>v1|c1 \<cdot>\<^sub>v u1 + c2 \<cdot>\<^sub>v u2\<rangle> + c4 * cnj \<langle>v2|c1 \<cdot>\<^sub>v u1 + c2 \<cdot>\<^sub>v u2\<rangle> = c3 * cnj (c1 * \<langle>v1|u1\<rangle> + c2 * \<langle>v1|u2\<rangle>) + c4 * cnj (c1 * \<langle>v2|u1\<rangle> + c2 * \<langle>v2|u2\<rangle>)
[PROOF STEP]
using inner_prod_is_linear[of "v1" "\<lambda>i. if i = 0 then u1 else u2" "\<lambda>i. if i = 0 then c1 else c2"]
          inner_prod_is_linear[of "v2" "\<lambda>i. if i = 0 then u1 else u2" "\<lambda>i. if i = 0 then c1 else c2"] assms
[PROOF STATE]
proof (prove)
using this:
\<forall>i\<in>{0, 1}. dim_vec v1 = dim_vec (if i = 0 then u1 else u2) \<Longrightarrow> \<langle>v1|(if 0 = 0 then c1 else c2) \<cdot>\<^sub>v (if 0 = 0 then u1 else u2) + (if 1 = 0 then c1 else c2) \<cdot>\<^sub>v (if 1 = 0 then u1 else u2)\<rangle> = (\<Sum>i\<le>1. (if i = 0 then c1 else c2) * \<langle>v1|if i = 0 then u1 else u2\<rangle>)
\<forall>i\<in>{0, 1}. dim_vec v2 = dim_vec (if i = 0 then u1 else u2) \<Longrightarrow> \<langle>v2|(if 0 = 0 then c1 else c2) \<cdot>\<^sub>v (if 0 = 0 then u1 else u2) + (if 1 = 0 then c1 else c2) \<cdot>\<^sub>v (if 1 = 0 then u1 else u2)\<rangle> = (\<Sum>i\<le>1. (if i = 0 then c1 else c2) * \<langle>v2|if i = 0 then u1 else u2\<rangle>)
dim_vec u1 = n
dim_vec u2 = n
dim_vec v1 = n
dim_vec v2 = n

goal (1 subgoal):
 1. c3 * cnj \<langle>v1|c1 \<cdot>\<^sub>v u1 + c2 \<cdot>\<^sub>v u2\<rangle> + c4 * cnj \<langle>v2|c1 \<cdot>\<^sub>v u1 + c2 \<cdot>\<^sub>v u2\<rangle> = c3 * cnj (c1 * \<langle>v1|u1\<rangle> + c2 * \<langle>v1|u2\<rangle>) + c4 * cnj (c1 * \<langle>v2|u1\<rangle> + c2 * \<langle>v2|u2\<rangle>)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
c3 * cnj \<langle>v1|c1 \<cdot>\<^sub>v u1 + c2 \<cdot>\<^sub>v u2\<rangle> + c4 * cnj \<langle>v2|c1 \<cdot>\<^sub>v u1 + c2 \<cdot>\<^sub>v u2\<rangle> = c3 * cnj (c1 * \<langle>v1|u1\<rangle> + c2 * \<langle>v1|u2\<rangle>) + c4 * cnj (c1 * \<langle>v2|u1\<rangle> + c2 * \<langle>v2|u2\<rangle>)

goal (1 subgoal):
 1. \<langle>c1 \<cdot>\<^sub>v u1 + c2 \<cdot>\<^sub>v u2|c3 \<cdot>\<^sub>v v1 + c4 \<cdot>\<^sub>v v2\<rangle> = cnj c1 * c3 * \<langle>u1|v1\<rangle> + cnj c2 * c3 * \<langle>u2|v1\<rangle> + cnj c1 * c4 * \<langle>u1|v2\<rangle> + cnj c2 * c4 * \<langle>u2|v2\<rangle>
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
c3 * cnj \<langle>v1|c1 \<cdot>\<^sub>v u1 + c2 \<cdot>\<^sub>v u2\<rangle> + c4 * cnj \<langle>v2|c1 \<cdot>\<^sub>v u1 + c2 \<cdot>\<^sub>v u2\<rangle> = c3 * cnj (c1 * \<langle>v1|u1\<rangle> + c2 * \<langle>v1|u2\<rangle>) + c4 * cnj (c1 * \<langle>v2|u1\<rangle> + c2 * \<langle>v2|u2\<rangle>)

goal (1 subgoal):
 1. \<langle>c1 \<cdot>\<^sub>v u1 + c2 \<cdot>\<^sub>v u2|c3 \<cdot>\<^sub>v v1 + c4 \<cdot>\<^sub>v v2\<rangle> = cnj c1 * c3 * \<langle>u1|v1\<rangle> + cnj c2 * c3 * \<langle>u2|v1\<rangle> + cnj c1 * c4 * \<langle>u1|v2\<rangle> + cnj c2 * c4 * \<langle>u2|v2\<rangle>
[PROOF STEP]
have "... = c3 * (cnj(c1) * \<langle>u1|v1\<rangle> + cnj(c2) * \<langle>u2|v1\<rangle>) +
                   c4 * (cnj(c1) * \<langle>u1|v2\<rangle> + cnj(c2) * \<langle>u2|v2\<rangle>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. c3 * cnj (c1 * \<langle>v1|u1\<rangle> + c2 * \<langle>v1|u2\<rangle>) + c4 * cnj (c1 * \<langle>v2|u1\<rangle> + c2 * \<langle>v2|u2\<rangle>) = c3 * (cnj c1 * \<langle>u1|v1\<rangle> + cnj c2 * \<langle>u2|v1\<rangle>) + c4 * (cnj c1 * \<langle>u1|v2\<rangle> + cnj c2 * \<langle>u2|v2\<rangle>)
[PROOF STEP]
using inner_prod_cnj[of "v1" "u1"] inner_prod_cnj[of "v1" "u2"]
          inner_prod_cnj[of "v2" "u1"] inner_prod_cnj[of "v2" "u2"] assms
[PROOF STATE]
proof (prove)
using this:
dim_vec v1 = dim_vec u1 \<Longrightarrow> \<langle>u1|v1\<rangle> = cnj \<langle>v1|u1\<rangle>
dim_vec v1 = dim_vec u2 \<Longrightarrow> \<langle>u2|v1\<rangle> = cnj \<langle>v1|u2\<rangle>
dim_vec v2 = dim_vec u1 \<Longrightarrow> \<langle>u1|v2\<rangle> = cnj \<langle>v2|u1\<rangle>
dim_vec v2 = dim_vec u2 \<Longrightarrow> \<langle>u2|v2\<rangle> = cnj \<langle>v2|u2\<rangle>
dim_vec u1 = n
dim_vec u2 = n
dim_vec v1 = n
dim_vec v2 = n

goal (1 subgoal):
 1. c3 * cnj (c1 * \<langle>v1|u1\<rangle> + c2 * \<langle>v1|u2\<rangle>) + c4 * cnj (c1 * \<langle>v2|u1\<rangle> + c2 * \<langle>v2|u2\<rangle>) = c3 * (cnj c1 * \<langle>u1|v1\<rangle> + cnj c2 * \<langle>u2|v1\<rangle>) + c4 * (cnj c1 * \<langle>u1|v2\<rangle> + cnj c2 * \<langle>u2|v2\<rangle>)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
c3 * cnj (c1 * \<langle>v1|u1\<rangle> + c2 * \<langle>v1|u2\<rangle>) + c4 * cnj (c1 * \<langle>v2|u1\<rangle> + c2 * \<langle>v2|u2\<rangle>) = c3 * (cnj c1 * \<langle>u1|v1\<rangle> + cnj c2 * \<langle>u2|v1\<rangle>) + c4 * (cnj c1 * \<langle>u1|v2\<rangle> + cnj c2 * \<langle>u2|v2\<rangle>)

goal (1 subgoal):
 1. \<langle>c1 \<cdot>\<^sub>v u1 + c2 \<cdot>\<^sub>v u2|c3 \<cdot>\<^sub>v v1 + c4 \<cdot>\<^sub>v v2\<rangle> = cnj c1 * c3 * \<langle>u1|v1\<rangle> + cnj c2 * c3 * \<langle>u2|v1\<rangle> + cnj c1 * c4 * \<langle>u1|v2\<rangle> + cnj c2 * c4 * \<langle>u2|v2\<rangle>
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
\<langle>c1 \<cdot>\<^sub>v u1 + c2 \<cdot>\<^sub>v u2|c3 \<cdot>\<^sub>v v1 + c4 \<cdot>\<^sub>v v2\<rangle> = c3 * (cnj c1 * \<langle>u1|v1\<rangle> + cnj c2 * \<langle>u2|v1\<rangle>) + c4 * (cnj c1 * \<langle>u1|v2\<rangle> + cnj c2 * \<langle>u2|v2\<rangle>)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<langle>c1 \<cdot>\<^sub>v u1 + c2 \<cdot>\<^sub>v u2|c3 \<cdot>\<^sub>v v1 + c4 \<cdot>\<^sub>v v2\<rangle> = c3 * (cnj c1 * \<langle>u1|v1\<rangle> + cnj c2 * \<langle>u2|v1\<rangle>) + c4 * (cnj c1 * \<langle>u1|v2\<rangle> + cnj c2 * \<langle>u2|v2\<rangle>)

goal (1 subgoal):
 1. \<langle>c1 \<cdot>\<^sub>v u1 + c2 \<cdot>\<^sub>v u2|c3 \<cdot>\<^sub>v v1 + c4 \<cdot>\<^sub>v v2\<rangle> = cnj c1 * c3 * \<langle>u1|v1\<rangle> + cnj c2 * c3 * \<langle>u2|v1\<rangle> + cnj c1 * c4 * \<langle>u1|v2\<rangle> + cnj c2 * c4 * \<langle>u2|v2\<rangle>
[PROOF STEP]
by (auto simp add: algebra_simps)
[PROOF STATE]
proof (state)
this:
\<langle>c1 \<cdot>\<^sub>v u1 + c2 \<cdot>\<^sub>v u2|c3 \<cdot>\<^sub>v v1 + c4 \<cdot>\<^sub>v v2\<rangle> = cnj c1 * c3 * \<langle>u1|v1\<rangle> + cnj c2 * c3 * \<langle>u2|v1\<rangle> + cnj c1 * c4 * \<langle>u1|v2\<rangle> + cnj c2 * c4 * \<langle>u2|v2\<rangle>

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma soundness:
assumes "check_eqv as r s" shows "lang (set as) r = lang (set as) s"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lang (set as) r = lang (set as) s
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. lang (set as) r = lang (set as) s
[PROOF STEP]
obtain ps where cl: "closure as ([(norm r,norm s)],[]) = Some([],ps)"
    and at: "atoms r \<union> atoms s \<subseteq> set as"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>ps. \<lbrakk>closure as ([(norm r, norm s)], []) = Some ([], ps); atoms r \<union> atoms s \<subseteq> set as\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
check_eqv as r s

goal (1 subgoal):
 1. (\<And>ps. \<lbrakk>closure as ([(norm r, norm s)], []) = Some ([], ps); atoms r \<union> atoms s \<subseteq> set as\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (auto simp: check_eqv_def set_add_atoms split:option.splits list.splits)
[PROOF STATE]
proof (state)
this:
closure as ([(norm r, norm s)], []) = Some ([], ps)
atoms r \<union> atoms s \<subseteq> set as

goal (1 subgoal):
 1. lang (set as) r = lang (set as) s
[PROOF STEP]
hence "atoms(norm r) \<union> atoms(norm s) \<subseteq> set as"
[PROOF STATE]
proof (prove)
using this:
closure as ([(norm r, norm s)], []) = Some ([], ps)
atoms r \<union> atoms s \<subseteq> set as

goal (1 subgoal):
 1. atoms (norm r) \<union> atoms (norm s) \<subseteq> set as
[PROOF STEP]
using atoms_norm
[PROOF STATE]
proof (prove)
using this:
closure as ([(norm r, norm s)], []) = Some ([], ps)
atoms r \<union> atoms s \<subseteq> set as
atoms (norm ?r) \<subseteq> atoms ?r

goal (1 subgoal):
 1. atoms (norm r) \<union> atoms (norm s) \<subseteq> set as
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
atoms (norm r) \<union> atoms (norm s) \<subseteq> set as

goal (1 subgoal):
 1. lang (set as) r = lang (set as) s
[PROOF STEP]
hence "lang (set as) (norm r) = lang (set as) (norm s)"
[PROOF STATE]
proof (prove)
using this:
atoms (norm r) \<union> atoms (norm s) \<subseteq> set as

goal (1 subgoal):
 1. lang (set as) (norm r) = lang (set as) (norm s)
[PROOF STEP]
by (rule closure_sound[OF cl])
[PROOF STATE]
proof (state)
this:
lang (set as) (norm r) = lang (set as) (norm s)

goal (1 subgoal):
 1. lang (set as) r = lang (set as) s
[PROOF STEP]
thus "lang (set as) r = lang (set as) s"
[PROOF STATE]
proof (prove)
using this:
lang (set as) (norm r) = lang (set as) (norm s)

goal (1 subgoal):
 1. lang (set as) r = lang (set as) s
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
lang (set as) r = lang (set as) s

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma expands_to_sgn_pos:
  assumes "trimmed_pos F" "(f expands_to F) basis" "basis_wf basis"
          "length basis = expansion_level TYPE('a :: multiseries)"
  shows   "((\<lambda>x. sgn (f x)) expands_to (const_expansion 1 :: 'a)) basis"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. sgn (f x)) expands_to const_expansion 1) basis
[PROOF STEP]
proof (rule expands_to_cong[OF expands_to_const])
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. basis_wf basis
 2. length basis = expansion_level TYPE('a)
 3. \<forall>\<^sub>F x in at_top. 1 = sgn (f x)
[PROOF STEP]
from trimmed_imp_eventually_sgn[of basis F] assms
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>basis_wf basis; is_expansion F basis; trimmed F\<rbrakk> \<Longrightarrow> \<forall>\<^sub>F x in at_top. sgn (eval F x) = sgn (fst (dominant_term F))
trimmed_pos F
(f expands_to F) basis
basis_wf basis
length basis = expansion_level TYPE('a)
[PROOF STEP]
have "eventually (\<lambda>x. sgn (eval F x) = 1) at_top"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>basis_wf basis; is_expansion F basis; trimmed F\<rbrakk> \<Longrightarrow> \<forall>\<^sub>F x in at_top. sgn (eval F x) = sgn (fst (dominant_term F))
trimmed_pos F
(f expands_to F) basis
basis_wf basis
length basis = expansion_level TYPE('a)

goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_top. sgn (eval F x) = 1
[PROOF STEP]
by (simp add: expands_to.simps trimmed_pos_def)
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in at_top. sgn (eval F x) = 1

goal (3 subgoals):
 1. basis_wf basis
 2. length basis = expansion_level TYPE('a)
 3. \<forall>\<^sub>F x in at_top. 1 = sgn (f x)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in at_top. sgn (eval F x) = 1

goal (3 subgoals):
 1. basis_wf basis
 2. length basis = expansion_level TYPE('a)
 3. \<forall>\<^sub>F x in at_top. 1 = sgn (f x)
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
trimmed_pos F
(f expands_to F) basis
basis_wf basis
length basis = expansion_level TYPE('a)
[PROOF STEP]
have "eventually (\<lambda>x. eval F x = f x) at_top"
[PROOF STATE]
proof (prove)
using this:
trimmed_pos F
(f expands_to F) basis
basis_wf basis
length basis = expansion_level TYPE('a)

goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_top. eval F x = f x
[PROOF STEP]
by (simp add: expands_to.simps)
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in at_top. eval F x = f x

goal (3 subgoals):
 1. basis_wf basis
 2. length basis = expansion_level TYPE('a)
 3. \<forall>\<^sub>F x in at_top. 1 = sgn (f x)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
\<forall>\<^sub>F x in at_top. sgn (eval F x) = 1
\<forall>\<^sub>F x in at_top. eval F x = f x
[PROOF STEP]
show "eventually (\<lambda>x. 1 = sgn (f x)) at_top"
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F x in at_top. sgn (eval F x) = 1
\<forall>\<^sub>F x in at_top. eval F x = f x

goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_top. 1 = sgn (f x)
[PROOF STEP]
by eventually_elim simp
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in at_top. 1 = sgn (f x)

goal (2 subgoals):
 1. basis_wf basis
 2. length basis = expansion_level TYPE('a)
[PROOF STEP]
qed (insert assms, auto)


[STATEMENT]
theorem exec_comp: "exec (comp a) s stk = aval a s # stk"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. exec (ASM.comp a) s stk = aval a s # stk
[PROOF STEP]
apply(induction a arbitrary: stk)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>x stk. exec (ASM.comp (N x)) s stk = aval (N x) s # stk
 2. \<And>x stk. exec (ASM.comp (V x)) s stk = aval (V x) s # stk
 3. \<And>a1 a2 stk. \<lbrakk>\<And>stk. exec (ASM.comp a1) s stk = aval a1 s # stk; \<And>stk. exec (ASM.comp a2) s stk = aval a2 s # stk\<rbrakk> \<Longrightarrow> exec (ASM.comp (Plus a1 a2)) s stk = aval (Plus a1 a2) s # stk
[PROOF STEP]
apply (auto)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma mat_tensor_prod_2_bis:
  assumes "state 1 v" and "state 1 w"
  shows "v \<Otimes> w = |Matrix.vec 4 (\<lambda>i. if i = 0 then v $$ (0,0) * w $$ (0,0) else
                                          if i = 3 then v $$ (1,0) * w $$ (1,0) else
                                            if i = 1 then v $$ (0,0) * w $$ (1,0) else
                                              v $$ (1,0) * w $$ (0,0))\<rangle>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. v \<Otimes> w = |Matrix.vec 4 (\<lambda>i. if i = 0 then v $$ (0, 0) * w $$ (0, 0) else if i = 3 then v $$ (1, 0) * w $$ (1, 0) else if i = 1 then v $$ (0, 0) * w $$ (1, 0) else v $$ (1, 0) * w $$ (0, 0))\<rangle>
[PROOF STEP]
using assms ket_vec_def mat_tensor_prod_2
[PROOF STATE]
proof (prove)
using this:
state 1 v
state 1 w
|?v\<rangle> \<equiv> Matrix.mat (dim_vec ?v) 1 (\<lambda>(i, j). ?v $ i)
\<lbrakk>state 1 ?v; state 1 ?w\<rbrakk> \<Longrightarrow> ?v \<Otimes> ?w = Matrix.mat 4 1 (\<lambda>(i, j). if i = 0 then ?v $$ (0, 0) * ?w $$ (0, 0) else if i = 3 then ?v $$ (1, 0) * ?w $$ (1, 0) else if i = 1 then ?v $$ (0, 0) * ?w $$ (1, 0) else ?v $$ (1, 0) * ?w $$ (0, 0))

goal (1 subgoal):
 1. v \<Otimes> w = |Matrix.vec 4 (\<lambda>i. if i = 0 then v $$ (0, 0) * w $$ (0, 0) else if i = 3 then v $$ (1, 0) * w $$ (1, 0) else if i = 1 then v $$ (0, 0) * w $$ (1, 0) else v $$ (1, 0) * w $$ (0, 0))\<rangle>
[PROOF STEP]
by(simp add: mat_eq_iff)


[STATEMENT]
lemma flow0_path_connected:
  assumes "path_connected D"
    "path_connected ts"
    "\<And>x. x \<in> D \<Longrightarrow> ts \<subseteq> existence_ivl0 x"
  shows "path_connected ( (\<lambda>(x, y). flow0 x y) ` (D \<times> ts))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. path_connected ((\<lambda>(x, y). flow0 x y) ` (D \<times> ts))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. path_connected ((\<lambda>(x, y). flow0 x y) ` (D \<times> ts))
[PROOF STEP]
have "D \<times> ts \<subseteq> Sigma X existence_ivl0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. D \<times> ts \<subseteq> Sigma X existence_ivl0
[PROOF STEP]
using assms(3) subset_iff
[PROOF STATE]
proof (prove)
using this:
?x \<in> D \<Longrightarrow> ts \<subseteq> existence_ivl0 ?x
(?A \<subseteq> ?B) = (\<forall>t. t \<in> ?A \<longrightarrow> t \<in> ?B)

goal (1 subgoal):
 1. D \<times> ts \<subseteq> Sigma X existence_ivl0
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
D \<times> ts \<subseteq> Sigma X existence_ivl0

goal (1 subgoal):
 1. path_connected ((\<lambda>(x, y). flow0 x y) ` (D \<times> ts))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
D \<times> ts \<subseteq> Sigma X existence_ivl0
[PROOF STEP]
have a1:"continuous_on (D \<times> ts) (\<lambda>(x, y). flow0 x y)"
[PROOF STATE]
proof (prove)
using this:
D \<times> ts \<subseteq> Sigma X existence_ivl0

goal (1 subgoal):
 1. continuous_on (D \<times> ts) (\<lambda>(x, y). flow0 x y)
[PROOF STEP]
using flow_continuous_on_state_space continuous_on_subset
[PROOF STATE]
proof (prove)
using this:
D \<times> ts \<subseteq> Sigma X existence_ivl0
continuous_on (Sigma X existence_ivl0) (\<lambda>(x, y). flow0 x y)
\<lbrakk>continuous_on ?s ?f; ?t \<subseteq> ?s\<rbrakk> \<Longrightarrow> continuous_on ?t ?f

goal (1 subgoal):
 1. continuous_on (D \<times> ts) (\<lambda>(x, y). flow0 x y)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
continuous_on (D \<times> ts) (\<lambda>(x, y). flow0 x y)

goal (1 subgoal):
 1. path_connected ((\<lambda>(x, y). flow0 x y) ` (D \<times> ts))
[PROOF STEP]
have a2 : "path_connected (D \<times> ts)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. path_connected (D \<times> ts)
[PROOF STEP]
using path_connected_Times assms
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>path_connected ?s; path_connected ?t\<rbrakk> \<Longrightarrow> path_connected (?s \<times> ?t)
path_connected D
path_connected ts
?x \<in> D \<Longrightarrow> ts \<subseteq> existence_ivl0 ?x

goal (1 subgoal):
 1. path_connected (D \<times> ts)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
path_connected (D \<times> ts)

goal (1 subgoal):
 1. path_connected ((\<lambda>(x, y). flow0 x y) ` (D \<times> ts))
[PROOF STEP]
from path_connected_continuous_image[OF a1 a2]
[PROOF STATE]
proof (chain)
picking this:
path_connected ((\<lambda>(x, y). flow0 x y) ` (D \<times> ts))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
path_connected ((\<lambda>(x, y). flow0 x y) ` (D \<times> ts))

goal (1 subgoal):
 1. path_connected ((\<lambda>(x, y). flow0 x y) ` (D \<times> ts))
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
path_connected ((\<lambda>(x, y). flow0 x y) ` (D \<times> ts))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma pos_meas_setI:
  assumes "E \<in> sets M"
    and "\<And>A. A \<in> sets M \<Longrightarrow> A \<subseteq> E \<Longrightarrow> 0 \<le> \<mu> A"
  shows "pos_meas_set E"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pos_meas_set E
[PROOF STEP]
unfolding pos_meas_set_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. E \<in> sets M \<and> (\<forall>A\<in>sets M. A \<subseteq> E \<longrightarrow> 0 \<le> \<mu> A)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
E \<in> sets M
\<lbrakk>?A \<in> sets M; ?A \<subseteq> E\<rbrakk> \<Longrightarrow> 0 \<le> \<mu> ?A

goal (1 subgoal):
 1. E \<in> sets M \<and> (\<forall>A\<in>sets M. A \<subseteq> E \<longrightarrow> 0 \<le> \<mu> A)
[PROOF STEP]
by simp


[STATEMENT]
lemma diag_mat_length:
  shows "length (diag_mat A) = dim_row A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length (diag_mat A) = dim_row A
[PROOF STEP]
unfolding diag_mat_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length (map (\<lambda>i. A $$ (i, i)) [0..<dim_row A]) = dim_row A
[PROOF STEP]
by simp


[STATEMENT]
lemma idmap_bij:"bij_to (idmap A) A A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bij_to (idmap A) A A
[PROOF STEP]
apply (simp add:bij_to_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. surj_to (idmap A) A A \<and> inj_on (idmap A) A
[PROOF STEP]
apply (rule conjI)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. surj_to (idmap A) A A
 2. inj_on (idmap A) A
[PROOF STEP]
apply (simp add:surj_to_def, simp add:image_def, simp add:idmap_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inj_on (idmap A) A
[PROOF STEP]
apply (simp add:inj_on_def, simp add:idmap_def)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma precedesTotalOrder:
  assumes "a \<in> set l" and "b \<in> set l"
  shows "a=b \<or> precedes a b l \<or> precedes b a l"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a = b \<or> precedes a b l \<or> precedes b a l
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
a \<in> set l
b \<in> set l

goal (1 subgoal):
 1. a = b \<or> precedes a b l \<or> precedes b a l
[PROOF STEP]
unfolding precedes_def
[PROOF STATE]
proof (prove)
using this:
a \<in> set l
b \<in> set l

goal (1 subgoal):
 1. a = b \<or> a \<in> set l \<and> b \<in> set l \<and> firstPos a l \<le> firstPos b l \<or> b \<in> set l \<and> a \<in> set l \<and> firstPos b l \<le> firstPos a l
[PROOF STEP]
by auto


[STATEMENT]
lemma closest_point_in_rel_frontier:
   "\<lbrakk>closed S; S \<noteq> {}; x \<in> affine hull S - rel_interior S\<rbrakk>
   \<Longrightarrow> closest_point S x \<in> rel_frontier S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>closed S; S \<noteq> {}; x \<in> affine hull S - rel_interior S\<rbrakk> \<Longrightarrow> closest_point S x \<in> rel_frontier S
[PROOF STEP]
by (simp add: closest_point_in_rel_interior closest_point_in_set rel_frontier_def)


[STATEMENT]
lemma homeomorphic_arc_images:
  fixes g :: "real \<Rightarrow> 'a::t2_space" and h :: "real \<Rightarrow> 'b::t2_space"
  assumes "arc g" "arc h"
  shows "(path_image g) homeomorphic (path_image h)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. path_image g homeomorphic path_image h
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. path_image g homeomorphic path_image h
[PROOF STEP]
have "(path_image g) homeomorphic {0..1::real}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. path_image g homeomorphic {0..1}
[PROOF STEP]
by (meson assms homeomorphic_def homeomorphic_sym homeomorphism_arc)
[PROOF STATE]
proof (state)
this:
path_image g homeomorphic {0..1}

goal (1 subgoal):
 1. path_image g homeomorphic path_image h
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
path_image g homeomorphic {0..1}

goal (1 subgoal):
 1. path_image g homeomorphic path_image h
[PROOF STEP]
have "\<dots> homeomorphic (path_image h)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {0..1} homeomorphic path_image h
[PROOF STEP]
by (meson assms homeomorphic_def homeomorphism_arc)
[PROOF STATE]
proof (state)
this:
{0..1} homeomorphic path_image h

goal (1 subgoal):
 1. path_image g homeomorphic path_image h
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
path_image g homeomorphic path_image h
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
path_image g homeomorphic path_image h

goal (1 subgoal):
 1. path_image g homeomorphic path_image h
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
path_image g homeomorphic path_image h

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma mset_subset_trans: "(M::'a multiset) \<subset># K \<Longrightarrow> K \<subset># N \<Longrightarrow> M \<subset># N"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>M \<subset># K; K \<subset># N\<rbrakk> \<Longrightarrow> M \<subset># N
[PROOF STEP]
by (fact subset_mset.less_trans)


[STATEMENT]
lemma in_out_arcs_reflexive_uniq: "v \<in> verts G \<Longrightarrow> (e \<in> (in_arcs G v) \<Longrightarrow>
    \<exists>! e' . (e' \<in> (out_arcs G v) \<and> head G e' = tail G e))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>v \<in> verts G; e \<in> in_arcs G v\<rbrakk> \<Longrightarrow> \<exists>!e'. e' \<in> out_arcs G v \<and> head G e' = tail G e
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>e \<in> arcs G; v = head G e\<rbrakk> \<Longrightarrow> \<exists>e'. e' \<in> arcs G \<and> tail G e' = head G e \<and> head G e' = tail G e
 2. \<And>e' y. \<lbrakk>e \<in> arcs G; v = head G e; e' \<in> arcs G; y \<in> arcs G; tail G e' = head G e; head G e' = tail G e; tail G y = head G e; head G y = tail G e\<rbrakk> \<Longrightarrow> e' = y
[PROOF STEP]
using symmetric_conv
[PROOF STATE]
proof (prove)
using this:
symmetric ?G = (\<forall>e1\<in>arcs ?G. \<exists>e2\<in>arcs ?G. tail ?G e1 = head ?G e2 \<and> head ?G e1 = tail ?G e2)

goal (2 subgoals):
 1. \<lbrakk>e \<in> arcs G; v = head G e\<rbrakk> \<Longrightarrow> \<exists>e'. e' \<in> arcs G \<and> tail G e' = head G e \<and> head G e' = tail G e
 2. \<And>e' y. \<lbrakk>e \<in> arcs G; v = head G e; e' \<in> arcs G; y \<in> arcs G; tail G e' = head G e; head G e' = tail G e; tail G y = head G e; head G y = tail G e\<rbrakk> \<Longrightarrow> e' = y
[PROOF STEP]
apply fastforce
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>e' y. \<lbrakk>e \<in> arcs G; v = head G e; e' \<in> arcs G; y \<in> arcs G; tail G e' = head G e; head G e' = tail G e; tail G y = head G e; head G y = tail G e\<rbrakk> \<Longrightarrow> e' = y
[PROOF STEP]
using out_arcs_single_per_vert
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?v \<in> verts G; ?u \<in> verts G; ?e1.0 \<in> out_arcs G ?v; ?e2.0 \<in> out_arcs G ?v; head G ?e1.0 = ?u; head G ?e2.0 = ?u\<rbrakk> \<Longrightarrow> ?e1.0 = ?e2.0

goal (1 subgoal):
 1. \<And>e' y. \<lbrakk>e \<in> arcs G; v = head G e; e' \<in> arcs G; y \<in> arcs G; tail G e' = head G e; head G e' = tail G e; tail G y = head G e; head G y = tail G e\<rbrakk> \<Longrightarrow> e' = y
[PROOF STEP]
by (metis head_in_verts in_out_arcs_conv)


[STATEMENT]
lemma height'_node21:
   "height r > 0 \<Longrightarrow> hD(node21 l' a r) = max (hD l') (height r) + 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < height r \<Longrightarrow> hD (node21 l' a r) = max (hD l') (height r) + 1
[PROOF STEP]
by(induct l' a r rule: node21.induct)(simp_all)


[STATEMENT]
lemma cspan_eqI:
  assumes \<open>\<And>a. a\<in>A \<Longrightarrow> a\<in>cspan B\<close>
  assumes \<open>\<And>b. b\<in>B \<Longrightarrow> b\<in>cspan A\<close>
  shows \<open>cspan A = cspan B\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cspan A = cspan B
[PROOF STEP]
apply (rule complex_vector.span_subspace[rotated])
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. cspan B \<subseteq> cspan A
 2. csubspace (cspan B)
 3. A \<subseteq> cspan B
[PROOF STEP]
apply (rule complex_vector.span_minimal)
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. B \<subseteq> cspan A
 2. csubspace (cspan A)
 3. csubspace (cspan B)
 4. A \<subseteq> cspan B
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
?a \<in> A \<Longrightarrow> ?a \<in> cspan B
?b \<in> B \<Longrightarrow> ?b \<in> cspan A

goal (4 subgoals):
 1. B \<subseteq> cspan A
 2. csubspace (cspan A)
 3. csubspace (cspan B)
 4. A \<subseteq> cspan B
[PROOF STEP]
by auto


[STATEMENT]
lemma lexord_trans:
  "\<lbrakk> (x, y) \<in> lexord r; (y, z) \<in> lexord r; trans r \<rbrakk> \<Longrightarrow> (x, z) \<in> lexord r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>(x, y) \<in> lexord r; (y, z) \<in> lexord r; trans r\<rbrakk> \<Longrightarrow> (x, z) \<in> lexord r
[PROOF STEP]
by(auto simp: trans_def intro:lexord_partial_trans)


[STATEMENT]
lemma log_one [simp]: "log 1 = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. local.log 1 = 0
[PROOF STEP]
by (simp add: log.simps)


[STATEMENT]
lemma eventually_zero:
"f \<bullet> ns (k + m) = \<zero> \<Longrightarrow> f \<bullet> ns (k + Suc m) = \<zero>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f \<bullet> ns (k + m) = \<zero> \<Longrightarrow> f \<bullet> ns (k + Suc m) = \<zero>
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. f \<bullet> ns (k + m) = \<zero> \<Longrightarrow> f \<bullet> ns (k + Suc m) = \<zero>
[PROOF STEP]
assume A: "f \<bullet> ns (k + m) = \<zero>"
[PROOF STATE]
proof (state)
this:
f \<bullet> ns (k + m) = \<zero>

goal (1 subgoal):
 1. f \<bullet> ns (k + m) = \<zero> \<Longrightarrow> f \<bullet> ns (k + Suc m) = \<zero>
[PROOF STEP]
have 0: "ns (k + Suc m) = ns (k + m) \<ominus> (divide (f \<bullet> ns (k + m)) (f' \<bullet> ns (k + m)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ns (k + Suc m) = ns (k + m) \<ominus> local.divide (f \<bullet> ns (k + m)) (f' \<bullet> ns (k + m))
[PROOF STEP]
by (simp add: newton_step_def)
[PROOF STATE]
proof (state)
this:
ns (k + Suc m) = ns (k + m) \<ominus> local.divide (f \<bullet> ns (k + m)) (f' \<bullet> ns (k + m))

goal (1 subgoal):
 1. f \<bullet> ns (k + m) = \<zero> \<Longrightarrow> f \<bullet> ns (k + Suc m) = \<zero>
[PROOF STEP]
have 1: "(divide (f \<bullet> ns (k + m)) (f' \<bullet> ns (k + m))) = \<zero>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. local.divide (f \<bullet> ns (k + m)) (f' \<bullet> ns (k + m)) = \<zero>
[PROOF STEP]
by (simp add: A divide_def)
[PROOF STATE]
proof (state)
this:
local.divide (f \<bullet> ns (k + m)) (f' \<bullet> ns (k + m)) = \<zero>

goal (1 subgoal):
 1. f \<bullet> ns (k + m) = \<zero> \<Longrightarrow> f \<bullet> ns (k + Suc m) = \<zero>
[PROOF STEP]
show "f \<bullet> ns (k + Suc m) = \<zero>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f \<bullet> ns (k + Suc m) = \<zero>
[PROOF STEP]
using A 0 1
[PROOF STATE]
proof (prove)
using this:
f \<bullet> ns (k + m) = \<zero>
ns (k + Suc m) = ns (k + m) \<ominus> local.divide (f \<bullet> ns (k + m)) (f' \<bullet> ns (k + m))
local.divide (f \<bullet> ns (k + m)) (f' \<bullet> ns (k + m)) = \<zero>

goal (1 subgoal):
 1. f \<bullet> ns (k + Suc m) = \<zero>
[PROOF STEP]
by (simp add: a_minus_def newton_seq_closed)
[PROOF STATE]
proof (state)
this:
f \<bullet> ns (k + Suc m) = \<zero>

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma (in euclidean_space) choice_Basis_iff:
  fixes P :: "'a \<Rightarrow> real \<Rightarrow> bool"
  shows "(\<forall>i\<in>Basis. \<exists>x. P i x) \<longleftrightarrow> (\<exists>x. \<forall>i\<in>Basis. P i (inner x i))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>i\<in>Basis. \<exists>x. P i x) = (\<exists>x. \<forall>i\<in>Basis. P i (inner x i))
[PROOF STEP]
unfolding bchoice_iff
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<exists>f. \<forall>i\<in>Basis. P i (f i)) = (\<exists>x. \<forall>i\<in>Basis. P i (inner x i))
[PROOF STEP]
proof safe
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>f. \<forall>i\<in>Basis. P i (f i) \<Longrightarrow> \<exists>x. \<forall>i\<in>Basis. P i (inner x i)
 2. \<And>x. \<forall>i\<in>Basis. P i (inner x i) \<Longrightarrow> \<exists>f. \<forall>i\<in>Basis. P i (f i)
[PROOF STEP]
fix f
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>f. \<forall>i\<in>Basis. P i (f i) \<Longrightarrow> \<exists>x. \<forall>i\<in>Basis. P i (inner x i)
 2. \<And>x. \<forall>i\<in>Basis. P i (inner x i) \<Longrightarrow> \<exists>f. \<forall>i\<in>Basis. P i (f i)
[PROOF STEP]
assume "\<forall>i\<in>Basis. P i (f i)"
[PROOF STATE]
proof (state)
this:
\<forall>i\<in>Basis. P i (f i)

goal (2 subgoals):
 1. \<And>f. \<forall>i\<in>Basis. P i (f i) \<Longrightarrow> \<exists>x. \<forall>i\<in>Basis. P i (inner x i)
 2. \<And>x. \<forall>i\<in>Basis. P i (inner x i) \<Longrightarrow> \<exists>f. \<forall>i\<in>Basis. P i (f i)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>i\<in>Basis. P i (f i)
[PROOF STEP]
show "\<exists>x. \<forall>i\<in>Basis. P i (inner x i)"
[PROOF STATE]
proof (prove)
using this:
\<forall>i\<in>Basis. P i (f i)

goal (1 subgoal):
 1. \<exists>x. \<forall>i\<in>Basis. P i (inner x i)
[PROOF STEP]
by (auto intro!: exI[of _ "\<Sum>i\<in>Basis. f i *\<^sub>R i"])
[PROOF STATE]
proof (state)
this:
\<exists>x. \<forall>i\<in>Basis. P i (inner x i)

goal (1 subgoal):
 1. \<And>x. \<forall>i\<in>Basis. P i (inner x i) \<Longrightarrow> \<exists>f. \<forall>i\<in>Basis. P i (f i)
[PROOF STEP]
qed auto


[STATEMENT]
lemma star_slide [ac_simps]: "(x \<cdot> y)\<^sup>\<star> \<cdot> x = x \<cdot> (y \<cdot> x)\<^sup>\<star>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x \<cdot> y)\<^sup>\<star> \<cdot> x = x \<cdot> (y \<cdot> x)\<^sup>\<star>
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (x \<cdot> y)\<^sup>\<star> \<cdot> x = x \<cdot> (y \<cdot> x)\<^sup>\<star>
[PROOF STEP]
have "x \<cdot> (y \<cdot> x)\<^sup>\<star> = x \<cdot> (1 + y \<cdot> (x \<cdot> y)\<^sup>\<star> \<cdot> x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<cdot> (y \<cdot> x)\<^sup>\<star> = x \<cdot> ((1::'a) + y \<cdot> (x \<cdot> y)\<^sup>\<star> \<cdot> x)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
x \<cdot> (y \<cdot> x)\<^sup>\<star> = x \<cdot> ((1::'a) + y \<cdot> (x \<cdot> y)\<^sup>\<star> \<cdot> x)

goal (1 subgoal):
 1. (x \<cdot> y)\<^sup>\<star> \<cdot> x = x \<cdot> (y \<cdot> x)\<^sup>\<star>
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
x \<cdot> (y \<cdot> x)\<^sup>\<star> = x \<cdot> ((1::'a) + y \<cdot> (x \<cdot> y)\<^sup>\<star> \<cdot> x)

goal (1 subgoal):
 1. (x \<cdot> y)\<^sup>\<star> \<cdot> x = x \<cdot> (y \<cdot> x)\<^sup>\<star>
[PROOF STEP]
have "... = (1 + x \<cdot> y \<cdot> (x \<cdot> y)\<^sup>\<star>) \<cdot> x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<cdot> ((1::'a) + y \<cdot> (x \<cdot> y)\<^sup>\<star> \<cdot> x) = ((1::'a) + x \<cdot> y \<cdot> (x \<cdot> y)\<^sup>\<star>) \<cdot> x
[PROOF STEP]
by (simp add: distrib_left mult_assoc)
[PROOF STATE]
proof (state)
this:
x \<cdot> ((1::'a) + y \<cdot> (x \<cdot> y)\<^sup>\<star> \<cdot> x) = ((1::'a) + x \<cdot> y \<cdot> (x \<cdot> y)\<^sup>\<star>) \<cdot> x

goal (1 subgoal):
 1. (x \<cdot> y)\<^sup>\<star> \<cdot> x = x \<cdot> (y \<cdot> x)\<^sup>\<star>
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
x \<cdot> (y \<cdot> x)\<^sup>\<star> = ((1::'a) + x \<cdot> y \<cdot> (x \<cdot> y)\<^sup>\<star>) \<cdot> x
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
x \<cdot> (y \<cdot> x)\<^sup>\<star> = ((1::'a) + x \<cdot> y \<cdot> (x \<cdot> y)\<^sup>\<star>) \<cdot> x

goal (1 subgoal):
 1. (x \<cdot> y)\<^sup>\<star> \<cdot> x = x \<cdot> (y \<cdot> x)\<^sup>\<star>
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(x \<cdot> y)\<^sup>\<star> \<cdot> x = x \<cdot> (y \<cdot> x)\<^sup>\<star>

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma lm092:
  "summedBidVectorRel bids N G = graph (N \<times> (Pow G-{{}})) (summedBidSecond bids)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. summedBidVectorRel bids N G = graph (N \<times> (Pow G - {{}})) (summedBidSecond bids)
[PROOF STEP]
unfolding graph_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. summedBidVectorRel bids N G = {summedBid bids x |x. x \<in> N \<times> (Pow G - {{}})}
[PROOF STEP]
using lm016
[PROOF STATE]
proof (prove)
using this:
summedBidVectorRel ?bids ?N ?G = {summedBid ?bids pair |pair. pair \<in> ?N \<times> (Pow ?G - {{}})}

goal (1 subgoal):
 1. summedBidVectorRel bids N G = {summedBid bids x |x. x \<in> N \<times> (Pow G - {{}})}
[PROOF STEP]
by blast


[STATEMENT]
lemma cl_op_prop_var [iff]: "(cl_op (x \<squnion> cl_op y) = cl_op y) = (cl_op (x::'a::clattice_with_clop) \<le> cl_op y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (cl_op (x \<squnion> cl_op y) = cl_op y) = (cl_op x \<le> cl_op y)
[PROOF STEP]
by (metis cl_op_prop clattice_with_clop_class.clop_idem_var)


[STATEMENT]
lemma changes_Cons:"changes (x#xs) = (if filter (\<lambda>x. x\<noteq>0) xs = [] then
                            0
                          else if x* hd (filter (\<lambda>x. x\<noteq>0) xs) < 0 then
                            1 + changes xs
                          else changes xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. changes (x # xs) = (if filter (\<lambda>x. x \<noteq> (0::'a)) xs = [] then 0 else if x * hd (filter (\<lambda>x. x \<noteq> (0::'a)) xs) < (0::'a) then 1 + changes xs else changes xs)
[PROOF STEP]
apply (induct xs)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. changes [x] = (if filter (\<lambda>x. x \<noteq> (0::'a)) [] = [] then 0 else if x * hd (filter (\<lambda>x. x \<noteq> (0::'a)) []) < (0::'a) then 1 + changes [] else changes [])
 2. \<And>a xs. changes (x # xs) = (if filter (\<lambda>x. x \<noteq> (0::'a)) xs = [] then 0 else if x * hd (filter (\<lambda>x. x \<noteq> (0::'a)) xs) < (0::'a) then 1 + changes xs else changes xs) \<Longrightarrow> changes (x # a # xs) = (if filter (\<lambda>x. x \<noteq> (0::'a)) (a # xs) = [] then 0 else if x * hd (filter (\<lambda>x. x \<noteq> (0::'a)) (a # xs)) < (0::'a) then 1 + changes (a # xs) else changes (a # xs))
[PROOF STEP]
by auto


[STATEMENT]
lemma gdd_index_zero_iff: "ps \<subseteq> \<V> \<Longrightarrow> card ps = 2 \<Longrightarrow>
    \<B> index ps = 0 \<longleftrightarrow> size {#b \<in>#  mset_set \<G> . ps \<subseteq> b#} = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>ps \<subseteq> \<V>; card ps = 2\<rbrakk> \<Longrightarrow> (\<B> index ps = 0) = (size (filter_mset ((\<subseteq>) ps) (mset_set \<G>)) = 1)
[PROOF STEP]
apply (auto simp add: index_zero_implies_one_group)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>ps \<subseteq> \<V>; card ps = 2; size (filter_mset ((\<subseteq>) ps) (mset_set \<G>)) = Suc 0\<rbrakk> \<Longrightarrow> \<B> index ps = 0
[PROOF STEP]
by (metis GDD.gdd_index_options GDD_axioms index_non_zero_implies_no_group old.nat.distinct(2))


[STATEMENT]
lemma "((x::real) \<noteq> y) = (x < y \<or> y < x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x \<noteq> y) = (x < y \<or> y < x)
[PROOF STEP]
by arith


[STATEMENT]
lemma disjoint_def: "disjoint A \<longleftrightarrow> (\<forall>a\<in>A. \<forall>b\<in>A. a \<noteq> b \<longrightarrow> a \<inter> b = {})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. disjoint A = (\<forall>a\<in>A. \<forall>b\<in>A. a \<noteq> b \<longrightarrow> a \<inter> b = {})
[PROOF STEP]
unfolding pairwise_def disjnt_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>x\<in>A. \<forall>y\<in>A. x \<noteq> y \<longrightarrow> x \<inter> y = {}) = (\<forall>a\<in>A. \<forall>b\<in>A. a \<noteq> b \<longrightarrow> a \<inter> b = {})
[PROOF STEP]
by auto