[STATEMENT]
lemma mk_and_atoms:
  "atoms_ltln (mk_and \<phi> \<psi>) \<subseteq> atoms_ltln \<phi> \<union> atoms_ltln \<psi>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. atoms_ltln (mk_and \<phi> \<psi>) \<subseteq> atoms_ltln \<phi> \<union> atoms_ltln \<psi>
[PROOF STEP]
by (auto simp: mk_and_def split: ltln.splits)


[STATEMENT]
lemma card_of_lists_infinite[simp]:
assumes "\<not>finite A"
shows "|lists A| =o |A|"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. |lists A| =o |A|
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. |lists A| =o |A|
[PROOF STEP]
have "|lists A| \<le>o |A|"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. |lists A| \<le>o |A|
[PROOF STEP]
unfolding lists_UNION_nlists
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. |\<Union> (range (nlists A))| \<le>o |A|
[PROOF STEP]
by (rule card_of_UNION_ordLeq_infinite[OF assms _ ballI[OF card_of_nlists_infinite[OF assms]]])
    (metis infinite_iff_card_of_nat assms)
[PROOF STATE]
proof (state)
this:
|lists A| \<le>o |A|

goal (1 subgoal):
 1. |lists A| =o |A|
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
|lists A| \<le>o |A|

goal (1 subgoal):
 1. |lists A| =o |A|
[PROOF STEP]
using card_of_lists ordIso_iff_ordLeq
[PROOF STATE]
proof (prove)
using this:
|lists A| \<le>o |A|
|?A| \<le>o |lists ?A|
(?r =o ?r') = (?r \<le>o ?r' \<and> ?r' \<le>o ?r)

goal (1 subgoal):
 1. |lists A| =o |A|
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
|lists A| =o |A|

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma (in Ring) ring_times_0_x:"x \<in> carrier R \<Longrightarrow> \<zero> \<cdot>\<^sub>r x = \<zero>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> carrier R \<Longrightarrow> \<zero> \<cdot>\<^sub>r x = \<zero>
[PROOF STEP]
apply (cut_tac ring_is_ag)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x \<in> carrier R; aGroup R\<rbrakk> \<Longrightarrow> \<zero> \<cdot>\<^sub>r x = \<zero>
[PROOF STEP]
apply (cut_tac ring_zero)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x \<in> carrier R; aGroup R; \<zero> \<in> carrier R\<rbrakk> \<Longrightarrow> \<zero> \<cdot>\<^sub>r x = \<zero>
[PROOF STEP]
apply (frule ring_distrib2 [of "x" "\<zero>" "\<zero>"], assumption+)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x \<in> carrier R; aGroup R; \<zero> \<in> carrier R; (\<zero> \<plusminus> \<zero>) \<cdot>\<^sub>r x = \<zero> \<cdot>\<^sub>r x \<plusminus> \<zero> \<cdot>\<^sub>r x\<rbrakk> \<Longrightarrow> \<zero> \<cdot>\<^sub>r x = \<zero>
[PROOF STEP]
apply (simp add:aGroup.ag_l_zero [of "R" "\<zero>"])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x \<in> carrier R; aGroup R; \<zero> \<in> carrier R; \<zero> \<cdot>\<^sub>r x = \<zero> \<cdot>\<^sub>r x \<plusminus> \<zero> \<cdot>\<^sub>r x\<rbrakk> \<Longrightarrow> \<zero> \<cdot>\<^sub>r x = \<zero>
[PROOF STEP]
apply (frule ring_tOp_closed [of "\<zero>" "x"], assumption+)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x \<in> carrier R; aGroup R; \<zero> \<in> carrier R; \<zero> \<cdot>\<^sub>r x = \<zero> \<cdot>\<^sub>r x \<plusminus> \<zero> \<cdot>\<^sub>r x; \<zero> \<cdot>\<^sub>r x \<in> carrier R\<rbrakk> \<Longrightarrow> \<zero> \<cdot>\<^sub>r x = \<zero>
[PROOF STEP]
apply (frule sym, thin_tac "\<zero> \<cdot>\<^sub>r x = \<zero> \<cdot>\<^sub>r x \<plusminus> \<zero> \<cdot>\<^sub>r x")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x \<in> carrier R; aGroup R; \<zero> \<in> carrier R; \<zero> \<cdot>\<^sub>r x \<in> carrier R; \<zero> \<cdot>\<^sub>r x \<plusminus> \<zero> \<cdot>\<^sub>r x = \<zero> \<cdot>\<^sub>r x\<rbrakk> \<Longrightarrow> \<zero> \<cdot>\<^sub>r x = \<zero>
[PROOF STEP]
apply (frule aGroup.ag_eq_sol2 [of "R" "\<zero> \<cdot>\<^sub>r x" "\<zero> \<cdot>\<^sub>r x" "\<zero> \<cdot>\<^sub>r x"],
        assumption+)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x \<in> carrier R; aGroup R; \<zero> \<in> carrier R; \<zero> \<cdot>\<^sub>r x \<in> carrier R; \<zero> \<cdot>\<^sub>r x \<plusminus> \<zero> \<cdot>\<^sub>r x = \<zero> \<cdot>\<^sub>r x; \<zero> \<cdot>\<^sub>r x = \<zero> \<cdot>\<^sub>r x \<plusminus> -\<^sub>a \<zero> \<cdot>\<^sub>r x\<rbrakk> \<Longrightarrow> \<zero> \<cdot>\<^sub>r x = \<zero>
[PROOF STEP]
apply (thin_tac "\<zero> \<cdot>\<^sub>r x \<plusminus> \<zero> \<cdot>\<^sub>r x = \<zero> \<cdot>\<^sub>r x")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x \<in> carrier R; aGroup R; \<zero> \<in> carrier R; \<zero> \<cdot>\<^sub>r x \<in> carrier R; \<zero> \<cdot>\<^sub>r x = \<zero> \<cdot>\<^sub>r x \<plusminus> -\<^sub>a \<zero> \<cdot>\<^sub>r x\<rbrakk> \<Longrightarrow> \<zero> \<cdot>\<^sub>r x = \<zero>
[PROOF STEP]
apply (simp add:aGroup.ag_r_inv1)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma p_not_div_choose_lemma:
  fixes p :: nat
  assumes eeq: "\<And>i. Suc i < K \<Longrightarrow> multiplicity p (Suc i) = multiplicity p (Suc (j + i))"
      and "k < K" and p: "prime p"
    shows "multiplicity p (j + k choose k) = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. multiplicity p (j + k choose k) = 0
[PROOF STEP]
using \<open>k < K\<close>
[PROOF STATE]
proof (prove)
using this:
k < K

goal (1 subgoal):
 1. multiplicity p (j + k choose k) = 0
[PROOF STEP]
proof (induction k)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. 0 < K \<Longrightarrow> multiplicity p (j + 0 choose 0) = 0
 2. \<And>k. \<lbrakk>k < K \<Longrightarrow> multiplicity p (j + k choose k) = 0; Suc k < K\<rbrakk> \<Longrightarrow> multiplicity p (j + Suc k choose Suc k) = 0
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:
0 < K

goal (2 subgoals):
 1. 0 < K \<Longrightarrow> multiplicity p (j + 0 choose 0) = 0
 2. \<And>k. \<lbrakk>k < K \<Longrightarrow> multiplicity p (j + k choose k) = 0; Suc k < K\<rbrakk> \<Longrightarrow> multiplicity p (j + Suc k choose Suc k) = 0
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
0 < K
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
0 < K

goal (1 subgoal):
 1. multiplicity p (j + 0 choose 0) = 0
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
multiplicity p (j + 0 choose 0) = 0

goal (1 subgoal):
 1. \<And>k. \<lbrakk>k < K \<Longrightarrow> multiplicity p (j + k choose k) = 0; Suc k < K\<rbrakk> \<Longrightarrow> multiplicity p (j + Suc k choose Suc k) = 0
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>k. \<lbrakk>k < K \<Longrightarrow> multiplicity p (j + k choose k) = 0; Suc k < K\<rbrakk> \<Longrightarrow> multiplicity p (j + Suc k choose Suc k) = 0
[PROOF STEP]
case (Suc k)
[PROOF STATE]
proof (state)
this:
k < K \<Longrightarrow> multiplicity p (j + k choose k) = 0
Suc k < K

goal (1 subgoal):
 1. \<And>k. \<lbrakk>k < K \<Longrightarrow> multiplicity p (j + k choose k) = 0; Suc k < K\<rbrakk> \<Longrightarrow> multiplicity p (j + Suc k choose Suc k) = 0
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
k < K \<Longrightarrow> multiplicity p (j + k choose k) = 0
Suc k < K
[PROOF STEP]
have *: "(Suc (j+k) choose Suc k) > 0"
[PROOF STATE]
proof (prove)
using this:
k < K \<Longrightarrow> multiplicity p (j + k choose k) = 0
Suc k < K

goal (1 subgoal):
 1. 0 < Suc (j + k) choose Suc k
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
0 < Suc (j + k) choose Suc k

goal (1 subgoal):
 1. \<And>k. \<lbrakk>k < K \<Longrightarrow> multiplicity p (j + k choose k) = 0; Suc k < K\<rbrakk> \<Longrightarrow> multiplicity p (j + Suc k choose Suc k) = 0
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
0 < Suc (j + k) choose Suc k
[PROOF STEP]
have "multiplicity p ((Suc (j+k) choose Suc k) * Suc k) = multiplicity p (Suc k)"
[PROOF STATE]
proof (prove)
using this:
0 < Suc (j + k) choose Suc k

goal (1 subgoal):
 1. multiplicity p ((Suc (j + k) choose Suc k) * Suc k) = multiplicity p (Suc k)
[PROOF STEP]
by (subst Suc_times_binomial_eq [symmetric], subst prime_elem_multiplicity_mult_distrib)
       (insert p Suc.prems, simp_all add: eeq [symmetric] Suc.IH)
[PROOF STATE]
proof (state)
this:
multiplicity p ((Suc (j + k) choose Suc k) * Suc k) = multiplicity p (Suc k)

goal (1 subgoal):
 1. \<And>k. \<lbrakk>k < K \<Longrightarrow> multiplicity p (j + k choose k) = 0; Suc k < K\<rbrakk> \<Longrightarrow> multiplicity p (j + Suc k choose Suc k) = 0
[PROOF STEP]
with p *
[PROOF STATE]
proof (chain)
picking this:
prime p
0 < Suc (j + k) choose Suc k
multiplicity p ((Suc (j + k) choose Suc k) * Suc k) = multiplicity p (Suc k)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
prime p
0 < Suc (j + k) choose Suc k
multiplicity p ((Suc (j + k) choose Suc k) * Suc k) = multiplicity p (Suc k)

goal (1 subgoal):
 1. multiplicity p (j + Suc k choose Suc k) = 0
[PROOF STEP]
by (subst (asm) prime_elem_multiplicity_mult_distrib) simp_all
[PROOF STATE]
proof (state)
this:
multiplicity p (j + Suc k choose Suc k) = 0

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma bigo_const_mult2: "O(\<lambda>x. c * f x) \<subseteq> O(f)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. O(\<lambda>x. c * f x) \<subseteq> O(f)
[PROOF STEP]
apply (rule bigo_elt_subset)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. c * f x) \<in> O(f)
[PROOF STEP]
apply (rule bigo_const_mult1)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma exH_k_mult_pre_is_psi:
  "exH_k (n - 1) *\<^sub>v ket_pre = \<psi>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. exH_k (n - 1) *\<^sub>v ket_pre = \<psi>
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. exH_k (n - 1) *\<^sub>v ket_pre = \<psi>
[PROOF STEP]
have "exH_k (n - 1) = H_k (n - 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. exH_k (n - 1) = H_k (n - 1)
[PROOF STEP]
using exH_eq_H
[PROOF STATE]
proof (prove)
using this:
exH_k (n - 1) = H_k (n - 1)

goal (1 subgoal):
 1. exH_k (n - 1) = H_k (n - 1)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
exH_k (n - 1) = H_k (n - 1)

goal (1 subgoal):
 1. exH_k (n - 1) *\<^sub>v ket_pre = \<psi>
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
exH_k (n - 1) = H_k (n - 1)

goal (1 subgoal):
 1. exH_k (n - 1) *\<^sub>v ket_pre = \<psi>
[PROOF STEP]
have "ket_zero_k (n - 1) = ket_pre"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ket_zero_k (n - 1) = ket_pre
[PROOF STEP]
using ket_zero_k_decode[of "n - 1"] ket_pre_def N_def n
[PROOF STATE]
proof (prove)
using this:
n - 1 < n \<Longrightarrow> ket_zero_k (n - 1) = Matrix.vec (2 ^ Suc (n - 1)) (\<lambda>k. if k = 0 then 1 else 0)
ket_pre = Matrix.vec N (\<lambda>k. if k = 0 then 1 else 0)
N = 2 ^ n
1 < n

goal (1 subgoal):
 1. ket_zero_k (n - 1) = ket_pre
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
ket_zero_k (n - 1) = ket_pre

goal (1 subgoal):
 1. exH_k (n - 1) *\<^sub>v ket_pre = \<psi>
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
ket_zero_k (n - 1) = ket_pre

goal (1 subgoal):
 1. exH_k (n - 1) *\<^sub>v ket_pre = \<psi>
[PROOF STEP]
have "ket_plus_k (n - 1) = \<psi>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ket_plus_k (n - 1) = \<psi>
[PROOF STEP]
using ket_plus_k_decode[of "n - 1"] \<psi>_def N_def n
[PROOF STATE]
proof (prove)
using this:
n - 1 < n \<Longrightarrow> ket_plus_k (n - 1) = Matrix.vec (2 ^ Suc (n - 1)) (\<lambda>l. 1 / csqrt (2 ^ Suc (n - 1)))
\<psi> = Matrix.vec N (\<lambda>x. complex_of_real (1 / sqrt (real N)))
N = 2 ^ n
1 < n

goal (1 subgoal):
 1. ket_plus_k (n - 1) = \<psi>
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
ket_plus_k (n - 1) = \<psi>

goal (1 subgoal):
 1. exH_k (n - 1) *\<^sub>v ket_pre = \<psi>
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
ket_plus_k (n - 1) = \<psi>

goal (1 subgoal):
 1. exH_k (n - 1) *\<^sub>v ket_pre = \<psi>
[PROOF STEP]
have "H_k (n - 1) *\<^sub>v ket_zero_k (n - 1) = ket_plus_k (n - 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. H_k (n - 1) *\<^sub>v ket_zero_k (n - 1) = ket_plus_k (n - 1)
[PROOF STEP]
using H_k_ket_zero_k n
[PROOF STATE]
proof (prove)
using this:
?k < n \<Longrightarrow> H_k ?k *\<^sub>v ket_zero_k ?k = ket_plus_k ?k
1 < n

goal (1 subgoal):
 1. H_k (n - 1) *\<^sub>v ket_zero_k (n - 1) = ket_plus_k (n - 1)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
H_k (n - 1) *\<^sub>v ket_zero_k (n - 1) = ket_plus_k (n - 1)

goal (1 subgoal):
 1. exH_k (n - 1) *\<^sub>v ket_pre = \<psi>
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
exH_k (n - 1) = H_k (n - 1)
ket_zero_k (n - 1) = ket_pre
ket_plus_k (n - 1) = \<psi>
H_k (n - 1) *\<^sub>v ket_zero_k (n - 1) = ket_plus_k (n - 1)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
exH_k (n - 1) = H_k (n - 1)
ket_zero_k (n - 1) = ket_pre
ket_plus_k (n - 1) = \<psi>
H_k (n - 1) *\<^sub>v ket_zero_k (n - 1) = ket_plus_k (n - 1)

goal (1 subgoal):
 1. exH_k (n - 1) *\<^sub>v ket_pre = \<psi>
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
exH_k (n - 1) *\<^sub>v ket_pre = \<psi>

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma reparam_path_image:
  assumes "reparam \<gamma>1 \<gamma>2"
  shows "path_image \<gamma>1 = path_image \<gamma>2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. path_image \<gamma>1 = path_image \<gamma>2
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
reparam \<gamma>1 \<gamma>2

goal (1 subgoal):
 1. path_image \<gamma>1 = path_image \<gamma>2
[PROOF STEP]
apply (auto simp add: reparam_def path_image_def image_def bij_betw_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>\<phi> xa. \<lbrakk>\<forall>x\<in>{0..1}. \<gamma>1 x = \<gamma>2 (\<phi> x); \<phi> piecewise_C1_differentiable_on {0..1}; \<phi> 0 = 0; \<phi> 1 = 1; inj_on \<phi> {0..1}; {y. \<exists>x\<in>{0..1}. y = \<phi> x} = {0..1}; \<phi> -` {0..1} \<subseteq> {0..1}; \<forall>x\<in>{0..1}. finite (\<phi> -` {x}); 0 \<le> xa; xa \<le> 1\<rbrakk> \<Longrightarrow> \<exists>x\<in>{0..1}. \<gamma>2 xa = \<gamma>2 (\<phi> x)
[PROOF STEP]
apply (force dest!: equalityD2)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma diamond_commutes:
    shows "t \<cdot> (u \\ t) = u \<cdot> (t \\ u)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. t \<cdot> u \ t = u \<cdot> t \ u
[PROOF STEP]
proof (cases "t \<frown> u")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. t \<frown> u \<Longrightarrow> t \<cdot> u \ t = u \<cdot> t \ u
 2. \<not> t \<frown> u \<Longrightarrow> t \<cdot> u \ t = u \<cdot> t \ u
[PROOF STEP]
show "\<not> t \<frown> u \<Longrightarrow> ?thesis"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> t \<frown> u \<Longrightarrow> t \<cdot> u \ t = u \<cdot> t \ u
[PROOF STEP]
by (metis comp_null(2) conI con_sym)
[PROOF STATE]
proof (state)
this:
\<not> t \<frown> u \<Longrightarrow> t \<cdot> u \ t = u \<cdot> t \ u

goal (1 subgoal):
 1. t \<frown> u \<Longrightarrow> t \<cdot> u \ t = u \<cdot> t \ u
[PROOF STEP]
assume con: "t \<frown> u"
[PROOF STATE]
proof (state)
this:
t \<frown> u

goal (1 subgoal):
 1. t \<frown> u \<Longrightarrow> t \<cdot> u \ t = u \<cdot> t \ u
[PROOF STEP]
have "(t \<cdot> (u \\ t)) \\ u = (t \\ u) \<cdot> ((u \\ t) \\ (u \\ t))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (t \<cdot> u \ t) \ u = t \ u \<cdot> (u \ t) \ (u \ t)
[PROOF STEP]
using con
[PROOF STATE]
proof (prove)
using this:
t \<frown> u

goal (1 subgoal):
 1. (t \<cdot> u \ t) \ u = t \ u \<cdot> (u \ t) \ (u \ t)
[PROOF STEP]
by (metis (no_types, lifting) arr_resid_iff_con con_compI(2) con_implies_arr(1)
            resid_comp(2) con_imp_arr_resid con_sym comp_def arr_comp\<^sub>E\<^sub>C src_resid conI)
[PROOF STATE]
proof (state)
this:
(t \<cdot> u \ t) \ u = t \ u \<cdot> (u \ t) \ (u \ t)

goal (1 subgoal):
 1. t \<frown> u \<Longrightarrow> t \<cdot> u \ t = u \<cdot> t \ u
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
(t \<cdot> u \ t) \ u = t \ u \<cdot> (u \ t) \ (u \ t)

goal (1 subgoal):
 1. t \<frown> u \<Longrightarrow> t \<cdot> u \ t = u \<cdot> t \ u
[PROOF STEP]
have "u \<lesssim> t \<cdot> (u \\ t)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. u \<lesssim> t \<cdot> u \ t
[PROOF STEP]
by (metis arr_resid_iff_con calculation con cong_reflexive comp_arr_trg resid_arr_self
            resid_comp(1) trg_resid_sym)
[PROOF STATE]
proof (state)
this:
u \<lesssim> t \<cdot> u \ t

goal (1 subgoal):
 1. t \<frown> u \<Longrightarrow> t \<cdot> u \ t = u \<cdot> t \ u
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
(t \<cdot> u \ t) \ u = t \ u \<cdot> (u \ t) \ (u \ t)
u \<lesssim> t \<cdot> u \ t
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(t \<cdot> u \ t) \ u = t \ u \<cdot> (u \ t) \ (u \ t)
u \<lesssim> t \<cdot> u \ t

goal (1 subgoal):
 1. t \<cdot> u \ t = u \<cdot> t \ u
[PROOF STEP]
by (metis comp_eqI con comp_arr_trg resid_arr_self arr_resid trg_resid_sym)
[PROOF STATE]
proof (state)
this:
t \<cdot> u \ t = u \<cdot> t \ u

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma Zfun_sum:
  assumes "finite s"
  assumes f: "\<And>i. i \<in> s \<Longrightarrow> Zfun (f i) F"
  shows "Zfun (\<lambda>x. sum (\<lambda>i. f i x) s) F"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Zfun (\<lambda>x. \<Sum>i\<in>s. f i x) F
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
finite s
?i \<in> s \<Longrightarrow> Zfun (f ?i) F

goal (1 subgoal):
 1. Zfun (\<lambda>x. \<Sum>i\<in>s. f i x) F
[PROOF STEP]
by induct (auto intro!: Zfun_zero Zfun_add)


[STATEMENT]
lemma bin_rsplit_len_le: "n \<noteq> 0 \<longrightarrow> ws = bin_rsplit n (nw, w) \<longrightarrow> length ws \<le> m \<longleftrightarrow> nw \<le> m * n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n \<noteq> 0 \<longrightarrow> ws = bin_rsplit n (nw, w) \<longrightarrow> (length ws \<le> m) = (nw \<le> m * n)
[PROOF STEP]
by (auto simp: bin_rsplit_def bin_rsplit_aux_len_le)


[STATEMENT]
lemma uGraph_from_list_invar_subset:
  "uGraph_from_list_invar L \<Longrightarrow> set L'\<subseteq> set L \<Longrightarrow> distinct L' \<Longrightarrow> uGraph_from_list_invar L'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>uGraph_from_list_invar L; set L' \<subseteq> set L; distinct L'\<rbrakk> \<Longrightarrow> uGraph_from_list_invar L'
[PROOF STEP]
unfolding uGraph_from_list_invar_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>distinct (map \<alpha> L) \<and> (\<forall>(u, w, v)\<in>set L. u \<noteq> v); set L' \<subseteq> set L; distinct L'\<rbrakk> \<Longrightarrow> distinct (map \<alpha> L') \<and> (\<forall>(u, w, v)\<in>set L'. u \<noteq> v)
[PROOF STEP]
by (auto simp: distinct_map inj_on_subset)


[STATEMENT]
lemma inprod_cvec_g_zero [simp]:
  assumes "z \<noteq> vec_zero"
  shows "Re \<langle>z, z\<rangle> > 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < Re \<langle>z,z\<rangle>
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. 0 < Re \<langle>z,z\<rangle>
[PROOF STEP]
have "\<forall> a b. a \<noteq> 0 \<or> b \<noteq> 0 \<longrightarrow> 0 < (Re a * Re a + Im a * Im a) + (Re b * Re b + Im b * Im b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>a b. a \<noteq> 0 \<or> b \<noteq> 0 \<longrightarrow> 0 < Re a * Re a + Im a * Im a + (Re b * Re b + Im b * Im b)
[PROOF STEP]
by (smt complex_eq_0 not_sum_squares_lt_zero power2_eq_square)
[PROOF STATE]
proof (state)
this:
\<forall>a b. a \<noteq> 0 \<or> b \<noteq> 0 \<longrightarrow> 0 < Re a * Re a + Im a * Im a + (Re b * Re b + Im b * Im b)

goal (1 subgoal):
 1. 0 < Re \<langle>z,z\<rangle>
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
\<forall>a b. a \<noteq> 0 \<or> b \<noteq> 0 \<longrightarrow> 0 < Re a * Re a + Im a * Im a + (Re b * Re b + Im b * Im b)

goal (1 subgoal):
 1. 0 < Re \<langle>z,z\<rangle>
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
\<forall>a b. a \<noteq> 0 \<or> b \<noteq> 0 \<longrightarrow> 0 < Re a * Re a + Im a * Im a + (Re b * Re b + Im b * Im b)
z \<noteq> vec_zero

goal (1 subgoal):
 1. 0 < Re \<langle>z,z\<rangle>
[PROOF STEP]
by (cases z, simp add: vec_cnj_def)
[PROOF STATE]
proof (state)
this:
0 < Re \<langle>z,z\<rangle>

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma semiconfluentp_equivclp: "equivclp r = r\<^sup>*\<^sup>* OO r\<inverse>\<inverse>\<^sup>*\<^sup>*" if r: "semiconfluentp r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. equivclp r = r\<^sup>*\<^sup>* OO r\<inverse>\<inverse>\<^sup>*\<^sup>*
[PROOF STEP]
proof(rule antisym[rotated] r_OO_conversep_into_equivclp predicate2I)+
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x y. equivclp r x y \<Longrightarrow> (r\<^sup>*\<^sup>* OO r\<inverse>\<inverse>\<^sup>*\<^sup>*) x y
[PROOF STEP]
show "(r\<^sup>*\<^sup>* OO r\<inverse>\<inverse>\<^sup>*\<^sup>*) x y" if "equivclp r x y" for x y
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (r\<^sup>*\<^sup>* OO r\<inverse>\<inverse>\<^sup>*\<^sup>*) x y
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
equivclp r x y

goal (1 subgoal):
 1. (r\<^sup>*\<^sup>* OO r\<inverse>\<inverse>\<^sup>*\<^sup>*) x y
[PROOF STEP]
unfolding equivclp_def rtranclp_conversep
[PROOF STATE]
proof (prove)
using this:
(symclp r)\<^sup>*\<^sup>* x y

goal (1 subgoal):
 1. (r\<^sup>*\<^sup>* OO r\<^sup>*\<^sup>*\<inverse>\<inverse>) x y
[PROOF STEP]
by(induction rule: converse_rtranclp_induct)
      (blast elim!: symclpE intro: converse_rtranclp_into_rtranclp rtranclp_trans dest: semiconfluentpD[OF r])+
[PROOF STATE]
proof (state)
this:
equivclp r ?x ?y \<Longrightarrow> (r\<^sup>*\<^sup>* OO r\<inverse>\<inverse>\<^sup>*\<^sup>*) ?x ?y

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma finsum_group:
  assumes "\<And>n. f n \<in> carrier R"
  assumes "\<And>n. g n \<in>  carrier R"
  shows "finite S \<Longrightarrow> finsum R f S \<oplus> finsum R g S = finsum R (\<lambda>n. f n \<oplus> g n) S "
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite S \<Longrightarrow> finsum R f S \<oplus> finsum R g S = (\<Oplus>n\<in>S. f n \<oplus> g n)
[PROOF STEP]
apply(erule finite.induct)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. finsum R f {} \<oplus> finsum R g {} = (\<Oplus>n\<in>{}. f n \<oplus> g n)
 2. \<And>A a. \<lbrakk>finite A; finsum R f A \<oplus> finsum R g A = (\<Oplus>n\<in>A. f n \<oplus> g n)\<rbrakk> \<Longrightarrow> finsum R f (insert a A) \<oplus> finsum R g (insert a A) = (\<Oplus>n\<in>insert a A. f n \<oplus> g n)
[PROOF STEP]
apply (metis finsum_empty r_zero zero_closed)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>A a. \<lbrakk>finite A; finsum R f A \<oplus> finsum R g A = (\<Oplus>n\<in>A. f n \<oplus> g n)\<rbrakk> \<Longrightarrow> finsum R f (insert a A) \<oplus> finsum R g (insert a A) = (\<Oplus>n\<in>insert a A. f n \<oplus> g n)
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>A a. \<lbrakk>finite A; finsum R f A \<oplus> finsum R g A = (\<Oplus>n\<in>A. f n \<oplus> g n)\<rbrakk> \<Longrightarrow> finsum R f (insert a A) \<oplus> finsum R g (insert a A) = (\<Oplus>n\<in>insert a A. f n \<oplus> g n)
[PROOF STEP]
fix A :: "'c set "
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>A a. \<lbrakk>finite A; finsum R f A \<oplus> finsum R g A = (\<Oplus>n\<in>A. f n \<oplus> g n)\<rbrakk> \<Longrightarrow> finsum R f (insert a A) \<oplus> finsum R g (insert a A) = (\<Oplus>n\<in>insert a A. f n \<oplus> g n)
[PROOF STEP]
fix a
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>A a. \<lbrakk>finite A; finsum R f A \<oplus> finsum R g A = (\<Oplus>n\<in>A. f n \<oplus> g n)\<rbrakk> \<Longrightarrow> finsum R f (insert a A) \<oplus> finsum R g (insert a A) = (\<Oplus>n\<in>insert a A. f n \<oplus> g n)
[PROOF STEP]
assume A0: "finite A"
[PROOF STATE]
proof (state)
this:
finite A

goal (1 subgoal):
 1. \<And>A a. \<lbrakk>finite A; finsum R f A \<oplus> finsum R g A = (\<Oplus>n\<in>A. f n \<oplus> g n)\<rbrakk> \<Longrightarrow> finsum R f (insert a A) \<oplus> finsum R g (insert a A) = (\<Oplus>n\<in>insert a A. f n \<oplus> g n)
[PROOF STEP]
assume A1: "finsum R f A \<oplus> finsum R g A = (\<Oplus>n\<in>A. f n \<oplus> g n)"
[PROOF STATE]
proof (state)
this:
finsum R f A \<oplus> finsum R g A = (\<Oplus>n\<in>A. f n \<oplus> g n)

goal (1 subgoal):
 1. \<And>A a. \<lbrakk>finite A; finsum R f A \<oplus> finsum R g A = (\<Oplus>n\<in>A. f n \<oplus> g n)\<rbrakk> \<Longrightarrow> finsum R f (insert a A) \<oplus> finsum R g (insert a A) = (\<Oplus>n\<in>insert a A. f n \<oplus> g n)
[PROOF STEP]
show "finsum R f (insert a A) \<oplus> finsum R g (insert a A) = (\<Oplus>n\<in>insert a A. f n \<oplus> g n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finsum R f (insert a A) \<oplus> finsum R g (insert a A) = (\<Oplus>n\<in>insert a A. f n \<oplus> g n)
[PROOF STEP]
proof(cases "a \<in> A")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. a \<in> A \<Longrightarrow> finsum R f (insert a A) \<oplus> finsum R g (insert a A) = (\<Oplus>n\<in>insert a A. f n \<oplus> g n)
 2. a \<notin> A \<Longrightarrow> finsum R f (insert a A) \<oplus> finsum R g (insert a A) = (\<Oplus>n\<in>insert a A. f n \<oplus> g n)
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
a \<in> A

goal (2 subgoals):
 1. a \<in> A \<Longrightarrow> finsum R f (insert a A) \<oplus> finsum R g (insert a A) = (\<Oplus>n\<in>insert a A. f n \<oplus> g n)
 2. a \<notin> A \<Longrightarrow> finsum R f (insert a A) \<oplus> finsum R g (insert a A) = (\<Oplus>n\<in>insert a A. f n \<oplus> g n)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
a \<in> A
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
a \<in> A

goal (1 subgoal):
 1. finsum R f (insert a A) \<oplus> finsum R g (insert a A) = (\<Oplus>n\<in>insert a A. f n \<oplus> g n)
[PROOF STEP]
by (metis A1 insert_absorb)
[PROOF STATE]
proof (state)
this:
finsum R f (insert a A) \<oplus> finsum R g (insert a A) = (\<Oplus>n\<in>insert a A. f n \<oplus> g n)

goal (1 subgoal):
 1. a \<notin> A \<Longrightarrow> finsum R f (insert a A) \<oplus> finsum R g (insert a A) = (\<Oplus>n\<in>insert a A. f n \<oplus> g n)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. a \<notin> A \<Longrightarrow> finsum R f (insert a A) \<oplus> finsum R g (insert a A) = (\<Oplus>n\<in>insert a A. f n \<oplus> g n)
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
a \<notin> A

goal (1 subgoal):
 1. a \<notin> A \<Longrightarrow> finsum R f (insert a A) \<oplus> finsum R g (insert a A) = (\<Oplus>n\<in>insert a A. f n \<oplus> g n)
[PROOF STEP]
have LHS: "finsum R f (insert a A) \<oplus> finsum R g (insert a A) =
                  (f a \<oplus> finsum R f A) \<oplus> (g a \<oplus> finsum R g A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finsum R f (insert a A) \<oplus> finsum R g (insert a A) = f a \<oplus> finsum R f A \<oplus> (g a \<oplus> finsum R g A)
[PROOF STEP]
using assms  finsum_insert[of A a f] finsum_insert[of A a g]
[PROOF STATE]
proof (prove)
using this:
f ?n23 \<in> carrier R
g ?n23 \<in> carrier R
\<lbrakk>finite A; a \<notin> A; f \<in> A \<rightarrow> carrier R; f a \<in> carrier R\<rbrakk> \<Longrightarrow> finsum R f (insert a A) = f a \<oplus> finsum R f A
\<lbrakk>finite A; a \<notin> A; g \<in> A \<rightarrow> carrier R; g a \<in> carrier R\<rbrakk> \<Longrightarrow> finsum R g (insert a A) = g a \<oplus> finsum R g A

goal (1 subgoal):
 1. finsum R f (insert a A) \<oplus> finsum R g (insert a A) = f a \<oplus> finsum R f A \<oplus> (g a \<oplus> finsum R g A)
[PROOF STEP]
by (metis A0 False Pi_I)
[PROOF STATE]
proof (state)
this:
finsum R f (insert a A) \<oplus> finsum R g (insert a A) = f a \<oplus> finsum R f A \<oplus> (g a \<oplus> finsum R g A)

goal (1 subgoal):
 1. a \<notin> A \<Longrightarrow> finsum R f (insert a A) \<oplus> finsum R g (insert a A) = (\<Oplus>n\<in>insert a A. f n \<oplus> g n)
[PROOF STEP]
have F0: "(\<lambda>n. f n \<oplus> g n) \<in> A \<rightarrow> carrier R"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. f n \<oplus> g n) \<in> A \<rightarrow> carrier R
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
f ?n23 \<in> carrier R
g ?n23 \<in> carrier R

goal (1 subgoal):
 1. (\<lambda>n. f n \<oplus> g n) \<in> A \<rightarrow> carrier R
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
(\<lambda>n. f n \<oplus> g n) \<in> A \<rightarrow> carrier R

goal (1 subgoal):
 1. a \<notin> A \<Longrightarrow> finsum R f (insert a A) \<oplus> finsum R g (insert a A) = (\<Oplus>n\<in>insert a A. f n \<oplus> g n)
[PROOF STEP]
have F1: "(f a \<oplus> g a) \<in> carrier  R"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f a \<oplus> g a \<in> carrier R
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
f ?n23 \<in> carrier R
g ?n23 \<in> carrier R

goal (1 subgoal):
 1. f a \<oplus> g a \<in> carrier R
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
f a \<oplus> g a \<in> carrier R

goal (1 subgoal):
 1. a \<notin> A \<Longrightarrow> finsum R f (insert a A) \<oplus> finsum R g (insert a A) = (\<Oplus>n\<in>insert a A. f n \<oplus> g n)
[PROOF STEP]
have RHS: " (\<Oplus>n\<in>insert a A. f n \<oplus> g n) = (f a \<oplus> g a) \<oplus> (\<Oplus>n\<in>A. f n \<oplus> g n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Oplus>n\<in>insert a A. f n \<oplus> g n) = f a \<oplus> g a \<oplus> (\<Oplus>n\<in>A. f n \<oplus> g n)
[PROOF STEP]
using F0 F1 assms finsum_insert[of A a " (\<lambda>n. f n \<oplus> g n)"] False A0
[PROOF STATE]
proof (prove)
using this:
(\<lambda>n. f n \<oplus> g n) \<in> A \<rightarrow> carrier R
f a \<oplus> g a \<in> carrier R
f ?n23 \<in> carrier R
g ?n23 \<in> carrier R
\<lbrakk>finite A; a \<notin> A; (\<lambda>n. f n \<oplus> g n) \<in> A \<rightarrow> carrier R; f a \<oplus> g a \<in> carrier R\<rbrakk> \<Longrightarrow> (\<Oplus>n\<in>insert a A. f n \<oplus> g n) = f a \<oplus> g a \<oplus> (\<Oplus>n\<in>A. f n \<oplus> g n)
a \<notin> A
finite A

goal (1 subgoal):
 1. (\<Oplus>n\<in>insert a A. f n \<oplus> g n) = f a \<oplus> g a \<oplus> (\<Oplus>n\<in>A. f n \<oplus> g n)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
(\<Oplus>n\<in>insert a A. f n \<oplus> g n) = f a \<oplus> g a \<oplus> (\<Oplus>n\<in>A. f n \<oplus> g n)

goal (1 subgoal):
 1. a \<notin> A \<Longrightarrow> finsum R f (insert a A) \<oplus> finsum R g (insert a A) = (\<Oplus>n\<in>insert a A. f n \<oplus> g n)
[PROOF STEP]
have F2: " f a \<oplus> finsum R f A \<oplus> (g a \<oplus> finsum R g A) = (f a \<oplus> g a) \<oplus> (finsum R f A \<oplus>  finsum R g A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f a \<oplus> finsum R f A \<oplus> (g a \<oplus> finsum R g A) = f a \<oplus> g a \<oplus> (finsum R f A \<oplus> finsum R g A)
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. f a \<oplus> finsum R f A \<oplus> (g a \<oplus> finsum R g A) = f a \<oplus> g a \<oplus> (finsum R f A \<oplus> finsum R g A)
[PROOF STEP]
have F20: "f a \<in> carrier R"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f a \<in> carrier R
[PROOF STEP]
using assms(1)
[PROOF STATE]
proof (prove)
using this:
f ?n23 \<in> carrier R

goal (1 subgoal):
 1. f a \<in> carrier R
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
f a \<in> carrier R

goal (1 subgoal):
 1. f a \<oplus> finsum R f A \<oplus> (g a \<oplus> finsum R g A) = f a \<oplus> g a \<oplus> (finsum R f A \<oplus> finsum R g A)
[PROOF STEP]
have F21: "g a \<in> carrier R"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. g a \<in> carrier R
[PROOF STEP]
using assms(2)
[PROOF STATE]
proof (prove)
using this:
g ?n23 \<in> carrier R

goal (1 subgoal):
 1. g a \<in> carrier R
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
g a \<in> carrier R

goal (1 subgoal):
 1. f a \<oplus> finsum R f A \<oplus> (g a \<oplus> finsum R g A) = f a \<oplus> g a \<oplus> (finsum R f A \<oplus> finsum R g A)
[PROOF STEP]
have F22: "finsum R f A \<in> carrier R"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finsum R f A \<in> carrier R
[PROOF STEP]
by (metis Pi_iff assms(1) finsum_closed)
[PROOF STATE]
proof (state)
this:
finsum R f A \<in> carrier R

goal (1 subgoal):
 1. f a \<oplus> finsum R f A \<oplus> (g a \<oplus> finsum R g A) = f a \<oplus> g a \<oplus> (finsum R f A \<oplus> finsum R g A)
[PROOF STEP]
have F23: "finsum R g A \<in> carrier R"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finsum R g A \<in> carrier R
[PROOF STEP]
by (metis Pi_I assms(2) finsum_closed)
[PROOF STATE]
proof (state)
this:
finsum R g A \<in> carrier R

goal (1 subgoal):
 1. f a \<oplus> finsum R f A \<oplus> (g a \<oplus> finsum R g A) = f a \<oplus> g a \<oplus> (finsum R f A \<oplus> finsum R g A)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f a \<oplus> finsum R f A \<oplus> (g a \<oplus> finsum R g A) = f a \<oplus> g a \<oplus> (finsum R f A \<oplus> finsum R g A)
[PROOF STEP]
using F21 F20 F22 F23
[PROOF STATE]
proof (prove)
using this:
g a \<in> carrier R
f a \<in> carrier R
finsum R f A \<in> carrier R
finsum R g A \<in> carrier R

goal (1 subgoal):
 1. f a \<oplus> finsum R f A \<oplus> (g a \<oplus> finsum R g A) = f a \<oplus> g a \<oplus> (finsum R f A \<oplus> finsum R g A)
[PROOF STEP]
using add.m_assoc add.m_closed add.m_lcomm
[PROOF STATE]
proof (prove)
using this:
g a \<in> carrier R
f a \<in> carrier R
finsum R f A \<in> carrier R
finsum R g A \<in> carrier R
\<lbrakk>?x \<in> carrier R; ?y \<in> carrier R; ?z \<in> carrier R\<rbrakk> \<Longrightarrow> ?x \<oplus> ?y \<oplus> ?z = ?x \<oplus> (?y \<oplus> ?z)
\<lbrakk>?x \<in> carrier R; ?y \<in> carrier R\<rbrakk> \<Longrightarrow> ?x \<oplus> ?y \<in> carrier R
\<lbrakk>?x \<in> carrier R; ?y \<in> carrier R; ?z \<in> carrier R\<rbrakk> \<Longrightarrow> ?x \<oplus> (?y \<oplus> ?z) = ?y \<oplus> (?x \<oplus> ?z)

goal (1 subgoal):
 1. f a \<oplus> finsum R f A \<oplus> (g a \<oplus> finsum R g A) = f a \<oplus> g a \<oplus> (finsum R f A \<oplus> finsum R g A)
[PROOF STEP]
by presburger
[PROOF STATE]
proof (state)
this:
f a \<oplus> finsum R f A \<oplus> (g a \<oplus> finsum R g A) = f a \<oplus> g a \<oplus> (finsum R f A \<oplus> finsum R g A)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
f a \<oplus> finsum R f A \<oplus> (g a \<oplus> finsum R g A) = f a \<oplus> g a \<oplus> (finsum R f A \<oplus> finsum R g A)

goal (1 subgoal):
 1. a \<notin> A \<Longrightarrow> finsum R f (insert a A) \<oplus> finsum R g (insert a A) = (\<Oplus>n\<in>insert a A. f n \<oplus> g n)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finsum R f (insert a A) \<oplus> finsum R g (insert a A) = (\<Oplus>n\<in>insert a A. f n \<oplus> g n)
[PROOF STEP]
using RHS LHS assms A1 F2
[PROOF STATE]
proof (prove)
using this:
(\<Oplus>n\<in>insert a A. f n \<oplus> g n) = f a \<oplus> g a \<oplus> (\<Oplus>n\<in>A. f n \<oplus> g n)
finsum R f (insert a A) \<oplus> finsum R g (insert a A) = f a \<oplus> finsum R f A \<oplus> (g a \<oplus> finsum R g A)
f ?n23 \<in> carrier R
g ?n23 \<in> carrier R
finsum R f A \<oplus> finsum R g A = (\<Oplus>n\<in>A. f n \<oplus> g n)
f a \<oplus> finsum R f A \<oplus> (g a \<oplus> finsum R g A) = f a \<oplus> g a \<oplus> (finsum R f A \<oplus> finsum R g A)

goal (1 subgoal):
 1. finsum R f (insert a A) \<oplus> finsum R g (insert a A) = (\<Oplus>n\<in>insert a A. f n \<oplus> g n)
[PROOF STEP]
by presburger
[PROOF STATE]
proof (state)
this:
finsum R f (insert a A) \<oplus> finsum R g (insert a A) = (\<Oplus>n\<in>insert a A. f n \<oplus> g n)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
finsum R f (insert a A) \<oplus> finsum R g (insert a A) = (\<Oplus>n\<in>insert a A. f n \<oplus> g n)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma break_point_gt_q_div_two:
  assumes "of_nat d < \<lceil>(log 2 q)::real\<rceil>"
  shows "\<lceil>q-(q/(2*2^d))\<rceil> > \<lfloor>q/2\<rfloor>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lfloor>real_of_int q / 2\<rfloor> < \<lceil>real_of_int q - real_of_int q / (2 * 2 ^ d)\<rceil>
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lfloor>real_of_int q / 2\<rfloor> < \<lceil>real_of_int q - real_of_int q / (2 * 2 ^ d)\<rceil>
[PROOF STEP]
have "1/((2::real)^d) \<le> (1::real)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 / 2 ^ d \<le> 1
[PROOF STEP]
using one_le_power[of 2 d]
[PROOF STATE]
proof (prove)
using this:
(1::?'b1) \<le> (2::?'b1) \<Longrightarrow> (1::?'b1) \<le> (2::?'b1) ^ d

goal (1 subgoal):
 1. 1 / 2 ^ d \<le> 1
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
1 / 2 ^ d \<le> 1

goal (1 subgoal):
 1. \<lfloor>real_of_int q / 2\<rfloor> < \<lceil>real_of_int q - real_of_int q / (2 * 2 ^ d)\<rceil>
[PROOF STEP]
have "\<lceil>q-(q/(2*2^d))\<rceil> \<ge> q-(q/2)* (1/(2^d))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real_of_int q - real_of_int q / 2 * (1 / 2 ^ d) \<le> real_of_int \<lceil>real_of_int q - real_of_int q / (2 * 2 ^ d)\<rceil>
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
real_of_int q - real_of_int q / 2 * (1 / 2 ^ d) \<le> real_of_int \<lceil>real_of_int q - real_of_int q / (2 * 2 ^ d)\<rceil>

goal (1 subgoal):
 1. \<lfloor>real_of_int q / 2\<rfloor> < \<lceil>real_of_int q - real_of_int q / (2 * 2 ^ d)\<rceil>
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
real_of_int q - real_of_int q / 2 * (1 / 2 ^ d) \<le> real_of_int \<lceil>real_of_int q - real_of_int q / (2 * 2 ^ d)\<rceil>

goal (1 subgoal):
 1. \<lfloor>real_of_int q / 2\<rfloor> < \<lceil>real_of_int q - real_of_int q / (2 * 2 ^ d)\<rceil>
[PROOF STEP]
have "q-(q/2)* (1/(2^d)) \<ge> q - q/2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real_of_int q - real_of_int q / 2 \<le> real_of_int q - real_of_int q / 2 * (1 / 2 ^ d)
[PROOF STEP]
using \<open>1/((2::real)^d) \<le> (1::real)\<close>
[PROOF STATE]
proof (prove)
using this:
1 / 2 ^ d \<le> 1

goal (1 subgoal):
 1. real_of_int q - real_of_int q / 2 \<le> real_of_int q - real_of_int q / 2 * (1 / 2 ^ d)
[PROOF STEP]
by (smt (z3) calculation divide_le_eq divide_nonneg_nonneg
      divide_self_if mult_left_mono of_int_nonneg
      times_divide_eq_right q_gt_zero)
[PROOF STATE]
proof (state)
this:
real_of_int q - real_of_int q / 2 \<le> real_of_int q - real_of_int q / 2 * (1 / 2 ^ d)

goal (1 subgoal):
 1. \<lfloor>real_of_int q / 2\<rfloor> < \<lceil>real_of_int q - real_of_int q / (2 * 2 ^ d)\<rceil>
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
real_of_int q - real_of_int q / 2 * (1 / 2 ^ d) \<le> real_of_int \<lceil>real_of_int q - real_of_int q / (2 * 2 ^ d)\<rceil>
real_of_int q - real_of_int q / 2 \<le> real_of_int q - real_of_int q / 2 * (1 / 2 ^ d)
[PROOF STEP]
have "\<lceil>q-(q/(2*2^d))\<rceil> \<ge> \<lceil>q/2\<rceil> "
[PROOF STATE]
proof (prove)
using this:
real_of_int q - real_of_int q / 2 * (1 / 2 ^ d) \<le> real_of_int \<lceil>real_of_int q - real_of_int q / (2 * 2 ^ d)\<rceil>
real_of_int q - real_of_int q / 2 \<le> real_of_int q - real_of_int q / 2 * (1 / 2 ^ d)

goal (1 subgoal):
 1. \<lceil>real_of_int q / 2\<rceil> \<le> \<lceil>real_of_int q - real_of_int q / (2 * 2 ^ d)\<rceil>
[PROOF STEP]
by linarith
[PROOF STATE]
proof (state)
this:
\<lceil>real_of_int q / 2\<rceil> \<le> \<lceil>real_of_int q - real_of_int q / (2 * 2 ^ d)\<rceil>

goal (1 subgoal):
 1. \<lfloor>real_of_int q / 2\<rfloor> < \<lceil>real_of_int q - real_of_int q / (2 * 2 ^ d)\<rceil>
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
\<lceil>real_of_int q / 2\<rceil> \<le> \<lceil>real_of_int q - real_of_int q / (2 * 2 ^ d)\<rceil>

goal (1 subgoal):
 1. \<lfloor>real_of_int q / 2\<rfloor> < \<lceil>real_of_int q - real_of_int q / (2 * 2 ^ d)\<rceil>
[PROOF STEP]
have "\<lceil>q/2\<rceil> > \<lfloor>q/2\<rfloor>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lfloor>real_of_int q / 2\<rfloor> < \<lceil>real_of_int q / 2\<rceil>
[PROOF STEP]
using prime_half[OF q_prime q_gt_two]
[PROOF STATE]
proof (prove)
using this:
\<lfloor>real_of_int q / 2\<rfloor> < \<lceil>real_of_int q / 2\<rceil>

goal (1 subgoal):
 1. \<lfloor>real_of_int q / 2\<rfloor> < \<lceil>real_of_int q / 2\<rceil>
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
\<lfloor>real_of_int q / 2\<rfloor> < \<lceil>real_of_int q / 2\<rceil>

goal (1 subgoal):
 1. \<lfloor>real_of_int q / 2\<rfloor> < \<lceil>real_of_int q - real_of_int q / (2 * 2 ^ d)\<rceil>
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
\<lceil>real_of_int q / 2\<rceil> \<le> \<lceil>real_of_int q - real_of_int q / (2 * 2 ^ d)\<rceil>
\<lfloor>real_of_int q / 2\<rfloor> < \<lceil>real_of_int q / 2\<rceil>
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<lceil>real_of_int q / 2\<rceil> \<le> \<lceil>real_of_int q - real_of_int q / (2 * 2 ^ d)\<rceil>
\<lfloor>real_of_int q / 2\<rfloor> < \<lceil>real_of_int q / 2\<rceil>

goal (1 subgoal):
 1. \<lfloor>real_of_int q / 2\<rfloor> < \<lceil>real_of_int q - real_of_int q / (2 * 2 ^ d)\<rceil>
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<lfloor>real_of_int q / 2\<rfloor> < \<lceil>real_of_int q - real_of_int q / (2 * 2 ^ d)\<rceil>

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma list_quotient3 [quot_thm]:
  assumes "Quotient3 R Abs Rep"
  shows "Quotient3 (list_all2 R) (map Abs) (map Rep)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Quotient3 (list_all2 R) (map Abs) (map Rep)
[PROOF STEP]
proof (rule Quotient3I)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>a. map Abs (map Rep a) = a
 2. \<And>a. list_all2 R (map Rep a) (map Rep a)
 3. \<And>r s. list_all2 R r s = (list_all2 R r r \<and> list_all2 R s s \<and> map Abs r = map Abs s)
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
Quotient3 R Abs Rep
[PROOF STEP]
have "\<And>x. Abs (Rep x) = x"
[PROOF STATE]
proof (prove)
using this:
Quotient3 R Abs Rep

goal (1 subgoal):
 1. \<And>x. Abs (Rep x) = x
[PROOF STEP]
by (rule Quotient3_abs_rep)
[PROOF STATE]
proof (state)
this:
Abs (Rep ?x) = ?x

goal (3 subgoals):
 1. \<And>a. map Abs (map Rep a) = a
 2. \<And>a. list_all2 R (map Rep a) (map Rep a)
 3. \<And>r s. list_all2 R r s = (list_all2 R r r \<and> list_all2 R s s \<and> map Abs r = map Abs s)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
Abs (Rep ?x) = ?x
[PROOF STEP]
show "\<And>xs. map Abs (map Rep xs) = xs"
[PROOF STATE]
proof (prove)
using this:
Abs (Rep ?x) = ?x

goal (1 subgoal):
 1. \<And>xs. map Abs (map Rep xs) = xs
[PROOF STEP]
by (simp add: comp_def)
[PROOF STATE]
proof (state)
this:
map Abs (map Rep ?xs) = ?xs

goal (2 subgoals):
 1. \<And>a. list_all2 R (map Rep a) (map Rep a)
 2. \<And>r s. list_all2 R r s = (list_all2 R r r \<and> list_all2 R s s \<and> map Abs r = map Abs s)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>a. list_all2 R (map Rep a) (map Rep a)
 2. \<And>r s. list_all2 R r s = (list_all2 R r r \<and> list_all2 R s s \<and> map Abs r = map Abs s)
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
Quotient3 R Abs Rep
[PROOF STEP]
have "\<And>x y. R (Rep x) (Rep y) \<longleftrightarrow> x = y"
[PROOF STATE]
proof (prove)
using this:
Quotient3 R Abs Rep

goal (1 subgoal):
 1. \<And>x y. R (Rep x) (Rep y) = (x = y)
[PROOF STEP]
by (rule Quotient3_rel_rep)
[PROOF STATE]
proof (state)
this:
R (Rep ?x) (Rep ?y) = (?x = ?y)

goal (2 subgoals):
 1. \<And>a. list_all2 R (map Rep a) (map Rep a)
 2. \<And>r s. list_all2 R r s = (list_all2 R r r \<and> list_all2 R s s \<and> map Abs r = map Abs s)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
R (Rep ?x) (Rep ?y) = (?x = ?y)
[PROOF STEP]
show "\<And>xs. list_all2 R (map Rep xs) (map Rep xs)"
[PROOF STATE]
proof (prove)
using this:
R (Rep ?x) (Rep ?y) = (?x = ?y)

goal (1 subgoal):
 1. \<And>xs. list_all2 R (map Rep xs) (map Rep xs)
[PROOF STEP]
by (simp add: list_all2_map1 list_all2_map2 list_all2_eq)
[PROOF STATE]
proof (state)
this:
list_all2 R (map Rep ?xs) (map Rep ?xs)

goal (1 subgoal):
 1. \<And>r s. list_all2 R r s = (list_all2 R r r \<and> list_all2 R s s \<and> map Abs r = map Abs s)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>r s. list_all2 R r s = (list_all2 R r r \<and> list_all2 R s s \<and> map Abs r = map Abs s)
[PROOF STEP]
fix xs ys
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>r s. list_all2 R r s = (list_all2 R r r \<and> list_all2 R s s \<and> map Abs r = map Abs s)
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
Quotient3 R Abs Rep
[PROOF STEP]
have "\<And>x y. R x x \<and> R y y \<and> Abs x = Abs y \<longleftrightarrow> R x y"
[PROOF STATE]
proof (prove)
using this:
Quotient3 R Abs Rep

goal (1 subgoal):
 1. \<And>x y. (R x x \<and> R y y \<and> Abs x = Abs y) = R x y
[PROOF STEP]
by (rule Quotient3_rel)
[PROOF STATE]
proof (state)
this:
(R ?x ?x \<and> R ?y ?y \<and> Abs ?x = Abs ?y) = R ?x ?y

goal (1 subgoal):
 1. \<And>r s. list_all2 R r s = (list_all2 R r r \<and> list_all2 R s s \<and> map Abs r = map Abs s)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(R ?x ?x \<and> R ?y ?y \<and> Abs ?x = Abs ?y) = R ?x ?y
[PROOF STEP]
show "list_all2 R xs ys \<longleftrightarrow> list_all2 R xs xs \<and> list_all2 R ys ys \<and> map Abs xs = map Abs ys"
[PROOF STATE]
proof (prove)
using this:
(R ?x ?x \<and> R ?y ?y \<and> Abs ?x = Abs ?y) = R ?x ?y

goal (1 subgoal):
 1. list_all2 R xs ys = (list_all2 R xs xs \<and> list_all2 R ys ys \<and> map Abs xs = map Abs ys)
[PROOF STEP]
by (induct xs ys rule: list_induct2') auto
[PROOF STATE]
proof (state)
this:
list_all2 R xs ys = (list_all2 R xs xs \<and> list_all2 R ys ys \<and> map Abs xs = map Abs ys)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma eventually_nonneg_pow [eventually_nonzero_simps]:
  "eventually_nonneg F f \<Longrightarrow> eventually_nonneg F (\<lambda>x. f x ^ n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eventually_nonneg F f \<Longrightarrow> eventually_nonneg F (\<lambda>x. f x ^ n)
[PROOF STEP]
by (induction n) (auto simp: eventually_nonzero_simps)


[STATEMENT]
lemma remove_all_cycles_distinct: "set ys \<subseteq> set xs \<Longrightarrow> distinct (remove_all_cycles xs ys)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set ys \<subseteq> set xs \<Longrightarrow> distinct (remove_all_cycles xs ys)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. set ys \<subseteq> set xs \<Longrightarrow> distinct (remove_all_cycles xs ys)
[PROOF STEP]
assume "set ys \<subseteq> set xs"
[PROOF STATE]
proof (state)
this:
set ys \<subseteq> set xs

goal (1 subgoal):
 1. set ys \<subseteq> set xs \<Longrightarrow> distinct (remove_all_cycles xs ys)
[PROOF STEP]
hence "\<forall> x \<in> set ys. cnt x (remove_all_cycles xs ys) \<le> 1"
[PROOF STATE]
proof (prove)
using this:
set ys \<subseteq> set xs

goal (1 subgoal):
 1. \<forall>x\<in>set ys. cnt x (remove_all_cycles xs ys) \<le> 1
[PROOF STEP]
using cnt_remove_all_cycles
[PROOF STATE]
proof (prove)
using this:
set ys \<subseteq> set xs
?x \<in> set ?xs \<Longrightarrow> cnt ?x (remove_all_cycles ?xs ?ys) \<le> 1

goal (1 subgoal):
 1. \<forall>x\<in>set ys. cnt x (remove_all_cycles xs ys) \<le> 1
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
\<forall>x\<in>set ys. cnt x (remove_all_cycles xs ys) \<le> 1

goal (1 subgoal):
 1. set ys \<subseteq> set xs \<Longrightarrow> distinct (remove_all_cycles xs ys)
[PROOF STEP]
hence "\<forall> x \<in> set (remove_all_cycles xs ys). cnt x (remove_all_cycles xs ys) \<le> 1"
[PROOF STATE]
proof (prove)
using this:
\<forall>x\<in>set ys. cnt x (remove_all_cycles xs ys) \<le> 1

goal (1 subgoal):
 1. \<forall>x\<in>set (remove_all_cycles xs ys). cnt x (remove_all_cycles xs ys) \<le> 1
[PROOF STEP]
using remove_all_cycles_subs
[PROOF STATE]
proof (prove)
using this:
\<forall>x\<in>set ys. cnt x (remove_all_cycles xs ys) \<le> 1
set (remove_all_cycles ?xs ?ys) \<subseteq> set ?ys

goal (1 subgoal):
 1. \<forall>x\<in>set (remove_all_cycles xs ys). cnt x (remove_all_cycles xs ys) \<le> 1
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
\<forall>x\<in>set (remove_all_cycles xs ys). cnt x (remove_all_cycles xs ys) \<le> 1

goal (1 subgoal):
 1. set ys \<subseteq> set xs \<Longrightarrow> distinct (remove_all_cycles xs ys)
[PROOF STEP]
thus "distinct (remove_all_cycles xs ys)"
[PROOF STATE]
proof (prove)
using this:
\<forall>x\<in>set (remove_all_cycles xs ys). cnt x (remove_all_cycles xs ys) \<le> 1

goal (1 subgoal):
 1. distinct (remove_all_cycles xs ys)
[PROOF STEP]
using cnt_distinct_intro
[PROOF STATE]
proof (prove)
using this:
\<forall>x\<in>set (remove_all_cycles xs ys). cnt x (remove_all_cycles xs ys) \<le> 1
\<forall>x\<in>set ?xs. cnt x ?xs \<le> 1 \<Longrightarrow> distinct ?xs

goal (1 subgoal):
 1. distinct (remove_all_cycles xs ys)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
distinct (remove_all_cycles xs ys)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma card_eq1_circline_type_zero:
  assumes "\<exists> z. circline_set H = {z}"
  shows "circline_type H = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. circline_type H = 0
[PROOF STEP]
proof (cases "circline_type H < 0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. circline_type H < 0 \<Longrightarrow> circline_type H = 0
 2. \<not> circline_type H < 0 \<Longrightarrow> circline_type H = 0
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
circline_type H < 0

goal (2 subgoals):
 1. circline_type H < 0 \<Longrightarrow> circline_type H = 0
 2. \<not> circline_type H < 0 \<Longrightarrow> circline_type H = 0
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
circline_type H < 0

goal (1 subgoal):
 1. circline_type H = 0
[PROOF STEP]
using circline_type_neg_card_gt3[of H] assms
[PROOF STATE]
proof (prove)
using this:
circline_type H < 0
circline_type H < 0 \<Longrightarrow> \<exists>A B C. A \<noteq> B \<and> A \<noteq> C \<and> B \<noteq> C \<and> {A, B, C} \<subseteq> circline_set H
\<exists>z. circline_set H = {z}

goal (1 subgoal):
 1. circline_type H = 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
circline_type H = 0

goal (1 subgoal):
 1. \<not> circline_type H < 0 \<Longrightarrow> circline_type H = 0
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> circline_type H < 0 \<Longrightarrow> circline_type H = 0
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> circline_type H < 0

goal (1 subgoal):
 1. \<not> circline_type H < 0 \<Longrightarrow> circline_type H = 0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. circline_type H = 0
[PROOF STEP]
proof (cases "circline_type H > 0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. 0 < circline_type H \<Longrightarrow> circline_type H = 0
 2. \<not> 0 < circline_type H \<Longrightarrow> circline_type H = 0
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
0 < circline_type H

goal (2 subgoals):
 1. 0 < circline_type H \<Longrightarrow> circline_type H = 0
 2. \<not> 0 < circline_type H \<Longrightarrow> circline_type H = 0
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
0 < circline_type H

goal (1 subgoal):
 1. circline_type H = 0
[PROOF STEP]
using circline_type_pos_card_eq0[of H] assms
[PROOF STATE]
proof (prove)
using this:
0 < circline_type H
0 < circline_type H \<Longrightarrow> circline_set H = {}
\<exists>z. circline_set H = {z}

goal (1 subgoal):
 1. circline_type H = 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
circline_type H = 0

goal (1 subgoal):
 1. \<not> 0 < circline_type H \<Longrightarrow> circline_type H = 0
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> 0 < circline_type H \<Longrightarrow> circline_type H = 0
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> 0 < circline_type H

goal (1 subgoal):
 1. \<not> 0 < circline_type H \<Longrightarrow> circline_type H = 0
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
\<not> 0 < circline_type H

goal (1 subgoal):
 1. circline_type H = 0
[PROOF STEP]
using \<open>\<not> (circline_type H) < 0\<close>
[PROOF STATE]
proof (prove)
using this:
\<not> 0 < circline_type H
\<not> circline_type H < 0

goal (1 subgoal):
 1. circline_type H = 0
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
circline_type H = 0

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
circline_type H = 0

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma list_induct_ssnoc [case_names Nil Single ssnoc]:
  assumes Nil   : "P []"
  and     Single: "\<And>x. P [x]"
  and     ssnoc : "\<And>xs x y. P (xs@[x]) \<Longrightarrow> P (xs@[x,y])"
  shows   "P xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. P xs
[PROOF STEP]
proof (induct xs rule: rev_induct)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. P []
 2. \<And>x xs. P xs \<Longrightarrow> P (xs @ [x])
[PROOF STEP]
case (snoc x xs)
[PROOF STATE]
proof (state)
this:
P xs

goal (2 subgoals):
 1. P []
 2. \<And>x xs. P xs \<Longrightarrow> P (xs @ [x])
[PROOF STEP]
with Single ssnoc
[PROOF STATE]
proof (chain)
picking this:
P [?x]
P (?xs @ [?x]) \<Longrightarrow> P (?xs @ [?x, ?y])
P xs
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
P [?x]
P (?xs @ [?x]) \<Longrightarrow> P (?xs @ [?x, ?y])
P xs

goal (1 subgoal):
 1. P (xs @ [x])
[PROOF STEP]
by (cases xs rule: rev_cases) auto
[PROOF STATE]
proof (state)
this:
P (xs @ [x])

goal (1 subgoal):
 1. P []
[PROOF STEP]
qed (rule Nil)


[STATEMENT]
lemma supp_union_fset:
  fixes S T::"'a::fs fset"
  shows "supp (S |\<union>| T) = supp S \<union> supp T"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. supp (S |\<union>| T) = supp S \<union> supp T
[PROOF STEP]
by (induct S) (auto)


[STATEMENT]
lemma arg_imp_in_complex_cone:
  assumes "Arg z \<in> {a..b}"
  shows   "z \<in> complex_cone a b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. z \<in> complex_cone a b
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. z \<in> complex_cone a b
[PROOF STEP]
have "z = rcis (norm z) (Arg z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. z = rcis (cmod z) (Arg z)
[PROOF STEP]
by (simp add: rcis_cmod_Arg)
[PROOF STATE]
proof (state)
this:
z = rcis (cmod z) (Arg z)

goal (1 subgoal):
 1. z \<in> complex_cone a b
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
z = rcis (cmod z) (Arg z)

goal (1 subgoal):
 1. z \<in> complex_cone a b
[PROOF STEP]
have "\<dots> \<in> complex_cone a b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rcis (cmod z) (Arg z) \<in> complex_cone a b
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
Arg z \<in> {a..b}

goal (1 subgoal):
 1. rcis (cmod z) (Arg z) \<in> complex_cone a b
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
rcis (cmod z) (Arg z) \<in> complex_cone a b

goal (1 subgoal):
 1. z \<in> complex_cone a b
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
z \<in> complex_cone a b
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
z \<in> complex_cone a b

goal (1 subgoal):
 1. z \<in> complex_cone a b
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
z \<in> complex_cone a b

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma supp_sum_insert[simp]:
  "finite (support_on S f) \<Longrightarrow>
    supp_sum f (insert x S) = (if x \<in> S then supp_sum f S else f x + supp_sum f S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (support_on S f) \<Longrightarrow> supp_sum f (insert x S) = (if x \<in> S then supp_sum f S else f x + supp_sum f S)
[PROOF STEP]
by (simp add: supp_sum_def in_support_on insert_absorb)


[STATEMENT]
lemma beukers_integral1_different:
  assumes "r > s"
  shows   "beukers_integral1 r s = (\<Sum>k\<in>{s<..r}. 1 / k ^ 2) / (r - s)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. beukers_integral1 r s = (\<Sum>k\<in>{s<..r}. 1 / real (k\<^sup>2)) / real (r - s)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. beukers_integral1 r s = (\<Sum>k\<in>{s<..r}. 1 / real (k\<^sup>2)) / real (r - s)
[PROOF STEP]
have "ln (a * b) * a ^ r * b ^ s / (1 - a * b) \<le> 0" if "a \<in> {0<..<1}" "b \<in> {0<..<1}" for a b :: real
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ln (a * b) * a ^ r * b ^ s / (1 - a * b) \<le> 0
[PROOF STEP]
using that mult_strict_mono[of a 1 b 1]
[PROOF STATE]
proof (prove)
using this:
a \<in> {0<..<1}
b \<in> {0<..<1}
\<lbrakk>a < 1; b < 1; 0 < 1; 0 \<le> b\<rbrakk> \<Longrightarrow> a * b < 1 * 1

goal (1 subgoal):
 1. ln (a * b) * a ^ r * b ^ s / (1 - a * b) \<le> 0
[PROOF STEP]
by (intro mult_nonpos_nonneg divide_nonpos_nonneg) auto
[PROOF STATE]
proof (state)
this:
\<lbrakk>?a \<in> {0<..<1}; ?b \<in> {0<..<1}\<rbrakk> \<Longrightarrow> ln (?a * ?b) * ?a ^ r * ?b ^ s / (1 - ?a * ?b) \<le> 0

goal (1 subgoal):
 1. beukers_integral1 r s = (\<Sum>k\<in>{s<..r}. 1 / real (k\<^sup>2)) / real (r - s)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?a \<in> {0<..<1}; ?b \<in> {0<..<1}\<rbrakk> \<Longrightarrow> ln (?a * ?b) * ?a ^ r * ?b ^ s / (1 - ?a * ?b) \<le> 0

goal (1 subgoal):
 1. beukers_integral1 r s = (\<Sum>k\<in>{s<..r}. 1 / real (k\<^sup>2)) / real (r - s)
[PROOF STEP]
using beukers_nn_integral1_different[OF assms]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?a \<in> {0<..<1}; ?b \<in> {0<..<1}\<rbrakk> \<Longrightarrow> ln (?a * ?b) * ?a ^ r * ?b ^ s / (1 - ?a * ?b) \<le> 0
beukers_nn_integral1 r s = ennreal ((\<Sum>k\<in>{s<..r}. 1 / real (k\<^sup>2)) / real (r - s))

goal (1 subgoal):
 1. beukers_integral1 r s = (\<Sum>k\<in>{s<..r}. 1 / real (k\<^sup>2)) / real (r - s)
[PROOF STEP]
unfolding beukers_nn_integral1_def beukers_integral1_def
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?a \<in> {0<..<1}; ?b \<in> {0<..<1}\<rbrakk> \<Longrightarrow> ln (?a * ?b) * ?a ^ r * ?b ^ s / (1 - ?a * ?b) \<le> 0
\<integral>\<^sup>+x\<in>{0<..<1} \<times> {0<..<1}. (case x of (x, y) \<Rightarrow> ennreal (- ln (x * y) / (1 - x * y) * x ^ r * y ^ s))\<partial>lborel = ennreal ((\<Sum>k\<in>{s<..r}. 1 / real (k\<^sup>2)) / real (r - s))

goal (1 subgoal):
 1. LBINT (x, y):{0<..<1} \<times> {0<..<1}. - ln (x * y) / (1 - x * y) * x ^ r * y ^ s = (\<Sum>k\<in>{s<..r}. 1 / real (k\<^sup>2)) / real (r - s)
[PROOF STEP]
by (intro set_integral_eq_nn_integral AE_I2)
       (auto simp flip: lborel_prod simp: case_prod_unfold set_borel_measurable_def
             intro: divide_nonpos_nonneg mult_nonpos_nonneg intro!: sum_nonneg divide_nonneg_nonneg)
[PROOF STATE]
proof (state)
this:
beukers_integral1 r s = (\<Sum>k\<in>{s<..r}. 1 / real (k\<^sup>2)) / real (r - s)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma scaleRat_uminus [simp]:
  "-1 *R x = - (x :: 'a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - 1 *R x = - x
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. - 1 *R x = - x
[PROOF STEP]
have "0  = -1 *R x + x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (0::'a) = - 1 *R x + x
[PROOF STEP]
using scaleRat_left_distrib[of "-1" 1 x]
[PROOF STATE]
proof (prove)
using this:
(- 1 + 1) *R x = - 1 *R x + 1 *R x

goal (1 subgoal):
 1. (0::'a) = - 1 *R x + x
[PROOF STEP]
by (simp add: scaleRat_one)
[PROOF STATE]
proof (state)
this:
(0::'a) = - 1 *R x + x

goal (1 subgoal):
 1. - 1 *R x = - x
[PROOF STEP]
have "-x = 0 - x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - x = (0::'a) - x
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
- x = (0::'a) - x

goal (1 subgoal):
 1. - 1 *R x = - x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
- x = (0::'a) - x
[PROOF STEP]
have "-x = -1 *R x + x - x"
[PROOF STATE]
proof (prove)
using this:
- x = (0::'a) - x

goal (1 subgoal):
 1. - x = - 1 *R x + x - x
[PROOF STEP]
using \<open>0  = -1 *R x + x\<close>
[PROOF STATE]
proof (prove)
using this:
- x = (0::'a) - x
(0::'a) = - 1 *R x + x

goal (1 subgoal):
 1. - x = - 1 *R x + x - x
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
- x = - 1 *R x + x - x

goal (1 subgoal):
 1. - 1 *R x = - x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
- x = - 1 *R x + x - x
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
- x = - 1 *R x + x - x

goal (1 subgoal):
 1. - 1 *R x = - x
[PROOF STEP]
by (simp add: add_assoc)
[PROOF STATE]
proof (state)
this:
- 1 *R x = - x

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma ftff_4: assumes dx: "dim_vec x = 4"
  and be: "x $ 0 = False \<and> x $ 1 = True \<and> x $ 2 = False \<and> x $ 3 = False"
  shows "ceros_of_boolean_input x = {0,2,3}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ceros_of_boolean_input x = {0, 2, 3}
[PROOF STEP]
using dx be
[PROOF STATE]
proof (prove)
using this:
dim_vec x = 4
x $ 0 = False \<and> x $ 1 = True \<and> x $ 2 = False \<and> x $ 3 = False

goal (1 subgoal):
 1. ceros_of_boolean_input x = {0, 2, 3}
[PROOF STEP]
unfolding ceros_of_boolean_input_def
[PROOF STATE]
proof (prove)
using this:
dim_vec x = 4
x $ 0 = False \<and> x $ 1 = True \<and> x $ 2 = False \<and> x $ 3 = False

goal (1 subgoal):
 1. {xa. xa < dim_vec x \<and> x $ xa = False} = {0, 2, 3}
[PROOF STEP]
using less_4_cases
[PROOF STATE]
proof (prove)
using this:
dim_vec x = 4
x $ 0 = False \<and> x $ 1 = True \<and> x $ 2 = False \<and> x $ 3 = False
?n < 4 \<Longrightarrow> ?n = 0 \<or> ?n = 1 \<or> ?n = 2 \<or> ?n = 3

goal (1 subgoal):
 1. {xa. xa < dim_vec x \<and> x $ xa = False} = {0, 2, 3}
[PROOF STEP]
by auto


[STATEMENT]
lemma Union_supports_multiset:
  shows "\<Union>{supp x | x. x \<in># M} supports M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Union> {supp x |x. x \<in># M} supports M
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<Union> {supp x |x. x \<in># M} supports M
[PROOF STEP]
have sw: "\<And>a b. ((\<And>x. x \<in># M \<Longrightarrow> (a \<rightleftharpoons> b) \<bullet> x = x) \<Longrightarrow> (a \<rightleftharpoons> b) \<bullet> M = M)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a b. (\<And>x. x \<in># M \<Longrightarrow> (a \<rightleftharpoons> b) \<bullet> x = x) \<Longrightarrow> (a \<rightleftharpoons> b) \<bullet> M = M
[PROOF STEP]
unfolding permute_multiset_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a b. (\<And>x. x \<in># M \<Longrightarrow> (a \<rightleftharpoons> b) \<bullet> x = x) \<Longrightarrow> image_mset (permute (a \<rightleftharpoons> b)) M = M
[PROOF STEP]
by (induct M) simp_all
[PROOF STATE]
proof (state)
this:
(\<And>x. x \<in># M \<Longrightarrow> (?a \<rightleftharpoons> ?b) \<bullet> x = x) \<Longrightarrow> (?a \<rightleftharpoons> ?b) \<bullet> M = M

goal (1 subgoal):
 1. \<Union> {supp x |x. x \<in># M} supports M
[PROOF STEP]
have "(\<Union>x\<in>set_mset M. supp x) supports M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Union> (supp ` set_mset M) supports M
[PROOF STEP]
by (auto intro!: sw swap_fresh_fresh simp add: fresh_def supports_def)
[PROOF STATE]
proof (state)
this:
\<Union> (supp ` set_mset M) supports M

goal (1 subgoal):
 1. \<Union> {supp x |x. x \<in># M} supports M
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<Union> (supp ` set_mset M) supports M

goal (1 subgoal):
 1. \<Union> {supp x |x. x \<in># M} supports M
[PROOF STEP]
have "(\<Union>x\<in>set_mset M. supp x) = (\<Union>{supp x | x. x \<in># M})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Union> (supp ` set_mset M) = \<Union> {supp x |x. x \<in># M}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<Union> (supp ` set_mset M) = \<Union> {supp x |x. x \<in># M}

goal (1 subgoal):
 1. \<Union> {supp x |x. x \<in># M} supports M
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
\<Union> {supp x |x. x \<in># M} supports M
[PROOF STEP]
show "(\<Union>{supp x | x. x \<in># M}) supports M"
[PROOF STATE]
proof (prove)
using this:
\<Union> {supp x |x. x \<in># M} supports M

goal (1 subgoal):
 1. \<Union> {supp x |x. x \<in># M} supports M
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
\<Union> {supp x |x. x \<in># M} supports M

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma lowdim_eq_hyperplane:
  fixes S :: "'a::euclidean_space set"
  assumes "dim S = DIM('a) - 1"
  obtains a where "a \<noteq> 0" and "span S = {x. a \<bullet> x = 0}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>a. \<lbrakk>a \<noteq> (0::'a); span S = {x. a \<bullet> x = 0}\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<And>a. \<lbrakk>a \<noteq> (0::'a); span S = {x. a \<bullet> x = 0}\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
have dimS: "dim S < DIM('a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dim S < DIM('a)
[PROOF STEP]
by (simp add: assms)
[PROOF STATE]
proof (state)
this:
dim S < DIM('a)

goal (1 subgoal):
 1. (\<And>a. \<lbrakk>a \<noteq> (0::'a); span S = {x. a \<bullet> x = 0}\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
dim S < DIM('a)
[PROOF STEP]
obtain b where b: "b \<noteq> 0" "span S \<subseteq> {a. b \<bullet> a = 0}"
[PROOF STATE]
proof (prove)
using this:
dim S < DIM('a)

goal (1 subgoal):
 1. (\<And>b. \<lbrakk>b \<noteq> (0::'a); span S \<subseteq> {a. b \<bullet> a = 0}\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using lowdim_subset_hyperplane [of S]
[PROOF STATE]
proof (prove)
using this:
dim S < DIM('a)
dim S < DIM('a) \<Longrightarrow> \<exists>a. a \<noteq> (0::'a) \<and> span S \<subseteq> {x. a \<bullet> x = 0}

goal (1 subgoal):
 1. (\<And>b. \<lbrakk>b \<noteq> (0::'a); span S \<subseteq> {a. b \<bullet> a = 0}\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
b \<noteq> (0::'a)
span S \<subseteq> {a. b \<bullet> a = 0}

goal (1 subgoal):
 1. (\<And>a. \<lbrakk>a \<noteq> (0::'a); span S = {x. a \<bullet> x = 0}\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. thesis
[PROOF STEP]
apply (rule that[OF b(1)])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. span S = {x. b \<bullet> x = 0}
[PROOF STEP]
apply (rule subspace_dim_equal)
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. subspace (span S)
 2. subspace {x. b \<bullet> x = 0}
 3. span S \<subseteq> {x. b \<bullet> x = 0}
 4. dim {x. b \<bullet> x = 0} \<le> dim (span S)
[PROOF STEP]
by (auto simp: assms b dim_hyperplane subspace_hyperplane)
[PROOF STATE]
proof (state)
this:
thesis

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma tllist_all2_cases[consumes 1, case_names TNil TCons, cases pred]:
  assumes "tllist_all2 P Q xs ys"
  obtains (TNil) b b' where "xs = TNil b" "ys = TNil b'" "Q b b'"
  | (TCons) x xs' y ys'
    where "xs = TCons x xs'" and "ys = TCons y ys'"
    and "P x y" and "tllist_all2 P Q xs' ys'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<And>b b'. \<lbrakk>xs = TNil b; ys = TNil b'; Q b b'\<rbrakk> \<Longrightarrow> thesis; \<And>x xs' y ys'. \<lbrakk>xs = TCons x xs'; ys = TCons y ys'; P x y; tllist_all2 P Q xs' ys'\<rbrakk> \<Longrightarrow> thesis\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
tllist_all2 P Q xs ys

goal (1 subgoal):
 1. \<lbrakk>\<And>b b'. \<lbrakk>xs = TNil b; ys = TNil b'; Q b b'\<rbrakk> \<Longrightarrow> thesis; \<And>x xs' y ys'. \<lbrakk>xs = TCons x xs'; ys = TCons y ys'; P x y; tllist_all2 P Q xs' ys'\<rbrakk> \<Longrightarrow> thesis\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
by(cases xs)(fastforce simp add: tllist_all2_TCons1 tllist_all2_TNil1)+


[STATEMENT]
lemma refl_onPI: "(\<And>a a'. r a a' \<Longrightarrow> a \<in> A \<and> a' \<in> A) \<Longrightarrow> (\<And>a. a : A \<Longrightarrow> r a a) \<Longrightarrow> refl_onP A r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<And>a a'. r a a' \<Longrightarrow> a \<in> A \<and> a' \<in> A; \<And>a. a \<in> A \<Longrightarrow> r a a\<rbrakk> \<Longrightarrow> refl_onP A r
[PROOF STEP]
by(rule refl_onI)(auto)


[STATEMENT]
lemma SA_Units_nonzero:
  assumes "f \<in> Units (SA m)"
  assumes "x \<in> carrier (Q\<^sub>p\<^bsup>m\<^esup>)"
  shows "f x \<in> nonzero Q\<^sub>p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f x \<in> nonzero Q\<^sub>p
[PROOF STEP]
unfolding nonzero_def  mem_Collect_eq
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f x \<in> carrier Q\<^sub>p \<and> f x \<noteq> \<zero>
[PROOF STEP]
apply(rule conjI)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. f x \<in> carrier Q\<^sub>p
 2. f x \<noteq> \<zero>
[PROOF STEP]
using assms  SA_Units_closed SA_car_memE(3)[of f m]
[PROOF STATE]
proof (prove)
using this:
f \<in> Units (SA m)
x \<in> carrier (Q\<^sub>p\<^bsup>m\<^esup>)
?f \<in> Units (SA ?n) \<Longrightarrow> ?f \<in> carrier (SA ?n)
f \<in> carrier (SA m) \<Longrightarrow> f \<in> carrier (Q\<^sub>p\<^bsup>m\<^esup>) \<rightarrow> carrier Q\<^sub>p

goal (2 subgoals):
 1. f x \<in> carrier Q\<^sub>p
 2. f x \<noteq> \<zero>
[PROOF STEP]
apply blast
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f x \<noteq> \<zero>
[PROOF STEP]
using assms SA_Units_memE'
[PROOF STATE]
proof (prove)
using this:
f \<in> Units (SA m)
x \<in> carrier (Q\<^sub>p\<^bsup>m\<^esup>)
\<lbrakk>?f \<in> Units (SA ?n); ?x \<in> carrier (Q\<^sub>p\<^bsup>?n\<^esup>)\<rbrakk> \<Longrightarrow> ?f ?x \<noteq> \<zero>

goal (1 subgoal):
 1. f x \<noteq> \<zero>
[PROOF STEP]
by blast


[STATEMENT]
lemma ltakeWhile_lappend1:
  "\<lbrakk> x \<in> lset xs; \<not> P x \<rbrakk> \<Longrightarrow> ltakeWhile P (lappend xs ys) = ltakeWhile P xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x \<in> lset xs; \<not> P x\<rbrakk> \<Longrightarrow> ltakeWhile P (lappend xs ys) = ltakeWhile P xs
[PROOF STEP]
by(induct rule: lset_induct) simp_all


[STATEMENT]
lemma map_vec_vec_of_list_eq_intro:
  assumes "map f xs = map g ys"
  shows "map_vec f (vec_of_list xs) = map_vec g (vec_of_list ys)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map_vec f (vec_of_list xs) = map_vec g (vec_of_list ys)
[PROOF STEP]
by (metis assms vec_of_list_map)


[STATEMENT]
lemma map_transform_append:
  "map_transform t ae (\<Delta>@\<Gamma>) = map_transform t ae \<Delta> @ map_transform t ae \<Gamma>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map_transform t ae (\<Delta> @ \<Gamma>) = map_transform t ae \<Delta> @ map_transform t ae \<Gamma>
[PROOF STEP]
unfolding map_transform_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map_ran (\<lambda>x. lift_transform t (ae x)) (\<Delta> @ \<Gamma>) = map_ran (\<lambda>x. lift_transform t (ae x)) \<Delta> @ map_ran (\<lambda>x. lift_transform t (ae x)) \<Gamma>
[PROOF STEP]
by (simp add: map_ran_append)


[STATEMENT]
lemma expand_fps_less_eq: "(f::('a,'b::dioid_one_zero) fps) \<le> g \<longleftrightarrow> (\<forall>n. f $ n \<le> g $ n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f \<le> g) = (\<forall>n. f $ n \<le> g $ n)
[PROOF STEP]
by (simp add: expand_fps_eq less_eq_def less_eq_fps_def)


[STATEMENT]
lemma star_closed_unfold: "x\<^sup>\<star> = x \<Longrightarrow> x = 1 + x \<cdot> x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x\<^sup>\<star> = x \<Longrightarrow> x = (1::'a) + x \<cdot> x
[PROOF STEP]
by (metis star_plus_one star_trans_eq)


[STATEMENT]
lemma convex_hull_set_sum:
  "convex hull (\<Sum>i\<in>A. B i) = (\<Sum>i\<in>A. convex hull (B i))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. convex hull sum B A = (\<Sum>i\<in>A. convex hull B i)
[PROOF STEP]
proof (cases "finite A")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. finite A \<Longrightarrow> convex hull sum B A = (\<Sum>i\<in>A. convex hull B i)
 2. infinite A \<Longrightarrow> convex hull sum B A = (\<Sum>i\<in>A. convex hull B i)
[PROOF STEP]
assume "finite A"
[PROOF STATE]
proof (state)
this:
finite A

goal (2 subgoals):
 1. finite A \<Longrightarrow> convex hull sum B A = (\<Sum>i\<in>A. convex hull B i)
 2. infinite A \<Longrightarrow> convex hull sum B A = (\<Sum>i\<in>A. convex hull B i)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
finite A
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
finite A

goal (1 subgoal):
 1. convex hull sum B A = (\<Sum>i\<in>A. convex hull B i)
[PROOF STEP]
by (induct set: finite, simp, simp add: convex_hull_set_plus)
[PROOF STATE]
proof (state)
this:
convex hull sum B A = (\<Sum>i\<in>A. convex hull B i)

goal (1 subgoal):
 1. infinite A \<Longrightarrow> convex hull sum B A = (\<Sum>i\<in>A. convex hull B i)
[PROOF STEP]
qed simp


[STATEMENT]
lemma take_nths_take_nths:
  "take_nths i m (take_nths j n xs) = take_nths ((i * 2^n) + j) (m + n) xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. take_nths i m (take_nths j n xs) = take_nths (i * 2 ^ n + j) (m + n) xs
[PROOF STEP]
by (induct xs arbitrary: i j; simp add: algebra_simps power_add)


[STATEMENT]
lemma fls_divide_base_factor':
  "fls_base_factor f / fls_base_factor g = fls_shift (fls_subdegree f - fls_subdegree g) (f/g)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fls_base_factor f / fls_base_factor g = fls_shift (fls_subdegree f - fls_subdegree g) (f / g)
[PROOF STEP]
using fls_divide_base_factor_numer[of f "fls_base_factor g"]
        fls_divide_base_factor_denom[of f g]
[PROOF STATE]
proof (prove)
using this:
fls_base_factor f / fls_base_factor g = fls_shift (fls_subdegree f) (f / fls_base_factor g)
f / fls_base_factor g = fls_shift (- fls_subdegree g) (f / g)

goal (1 subgoal):
 1. fls_base_factor f / fls_base_factor g = fls_shift (fls_subdegree f - fls_subdegree g) (f / g)
[PROOF STEP]
by    simp


[STATEMENT]
lemma fps_of_poly_pcompose:
  assumes "coeff q 0 = (0 :: 'a :: idom)"
  shows   "fps_of_poly (pcompose p q) = fps_compose (fps_of_poly p) (fps_of_poly q)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fps_of_poly (p \<circ>\<^sub>p q) = fps_of_poly p oo fps_of_poly q
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
coeff q 0 = (0::'a)

goal (1 subgoal):
 1. fps_of_poly (p \<circ>\<^sub>p q) = fps_of_poly p oo fps_of_poly q
[PROOF STEP]
by (induction p rule: pCons_induct)
                 (auto simp: pcompose_pCons fps_of_poly_simps fps_of_poly_pCons
                             fps_compose_add_distrib fps_compose_mult_distrib)


[STATEMENT]
lemma (in prob_space) bound_L1_Lp:
  assumes "p \<ge> (1::real)"
          "f \<in> borel_measurable M"
          "integrable M (\<lambda>x. \<bar>f x\<bar> powr p)"
  shows "integrable M f"
        "abs(\<integral>x. f x \<partial>M) powr p \<le> (\<integral>x. \<bar>f x\<bar> powr p \<partial>M)"
        "abs(\<integral>x. f x \<partial>M) \<le> (\<integral>x. \<bar>f x\<bar> powr p \<partial>M) powr (1/p)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integrable M f &&& \<bar>expectation f\<bar> powr p \<le> expectation (\<lambda>x. \<bar>f x\<bar> powr p) &&& \<bar>expectation f\<bar> \<le> expectation (\<lambda>x. \<bar>f x\<bar> powr p) powr (1 / p)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. integrable M f
 2. \<bar>expectation f\<bar> powr p \<le> expectation (\<lambda>x. \<bar>f x\<bar> powr p)
 3. \<bar>expectation f\<bar> \<le> expectation (\<lambda>x. \<bar>f x\<bar> powr p) powr (1 / p)
[PROOF STEP]
have *: "norm x \<le> 1 + (norm x) powr p" for x::real
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm x \<le> 1 + norm x powr p
[PROOF STEP]
apply (cases "norm x \<le> 1")
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. norm x \<le> 1 \<Longrightarrow> norm x \<le> 1 + norm x powr p
 2. \<not> norm x \<le> 1 \<Longrightarrow> norm x \<le> 1 + norm x powr p
[PROOF STEP]
apply (meson le_add_same_cancel1 order.trans powr_ge_pzero)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> norm x \<le> 1 \<Longrightarrow> norm x \<le> 1 + norm x powr p
[PROOF STEP]
apply (metis add_le_same_cancel2 assms(1) less_le_trans linear not_less not_one_le_zero powr_le_cancel_iff powr_one_gt_zero_iff)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
norm ?x12 \<le> 1 + norm ?x12 powr p

goal (3 subgoals):
 1. integrable M f
 2. \<bar>expectation f\<bar> powr p \<le> expectation (\<lambda>x. \<bar>f x\<bar> powr p)
 3. \<bar>expectation f\<bar> \<le> expectation (\<lambda>x. \<bar>f x\<bar> powr p) powr (1 / p)
[PROOF STEP]
show *: "integrable M f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integrable M f
[PROOF STEP]
apply (rule Bochner_Integration.integrable_bound[of _ "\<lambda>x. 1 + \<bar>f x\<bar> powr p"], auto simp add: assms)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. AE x in M. \<bar>f x\<bar> \<le> 1 + \<bar>f x\<bar> powr p
[PROOF STEP]
using *
[PROOF STATE]
proof (prove)
using this:
norm ?x12 \<le> 1 + norm ?x12 powr p

goal (1 subgoal):
 1. AE x in M. \<bar>f x\<bar> \<le> 1 + \<bar>f x\<bar> powr p
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
integrable M f

goal (2 subgoals):
 1. \<bar>expectation f\<bar> powr p \<le> expectation (\<lambda>x. \<bar>f x\<bar> powr p)
 2. \<bar>expectation f\<bar> \<le> expectation (\<lambda>x. \<bar>f x\<bar> powr p) powr (1 / p)
[PROOF STEP]
show "abs(\<integral>x. f x \<partial>M) powr p \<le> (\<integral>x. \<bar>f x\<bar> powr p \<partial>M)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<bar>expectation f\<bar> powr p \<le> expectation (\<lambda>x. \<bar>f x\<bar> powr p)
[PROOF STEP]
by (rule jensens_inequality[OF * _ _ assms(3) convex_abs_powr[OF \<open>p \<ge> 1\<close>]], auto)
[PROOF STATE]
proof (state)
this:
\<bar>expectation f\<bar> powr p \<le> expectation (\<lambda>x. \<bar>f x\<bar> powr p)

goal (1 subgoal):
 1. \<bar>expectation f\<bar> \<le> expectation (\<lambda>x. \<bar>f x\<bar> powr p) powr (1 / p)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<bar>expectation f\<bar> powr p \<le> expectation (\<lambda>x. \<bar>f x\<bar> powr p)
[PROOF STEP]
have "(abs(\<integral>x. f x \<partial>M) powr p) powr (1/p) \<le> (\<integral>x. \<bar>f x\<bar> powr p \<partial>M) powr (1/p)"
[PROOF STATE]
proof (prove)
using this:
\<bar>expectation f\<bar> powr p \<le> expectation (\<lambda>x. \<bar>f x\<bar> powr p)

goal (1 subgoal):
 1. (\<bar>expectation f\<bar> powr p) powr (1 / p) \<le> expectation (\<lambda>x. \<bar>f x\<bar> powr p) powr (1 / p)
[PROOF STEP]
using assms(1) powr_mono2
[PROOF STATE]
proof (prove)
using this:
\<bar>expectation f\<bar> powr p \<le> expectation (\<lambda>x. \<bar>f x\<bar> powr p)
1 \<le> p
\<lbrakk>0 \<le> ?a; 0 \<le> ?x; ?x \<le> ?y\<rbrakk> \<Longrightarrow> ?x powr ?a \<le> ?y powr ?a

goal (1 subgoal):
 1. (\<bar>expectation f\<bar> powr p) powr (1 / p) \<le> expectation (\<lambda>x. \<bar>f x\<bar> powr p) powr (1 / p)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<bar>expectation f\<bar> powr p) powr (1 / p) \<le> expectation (\<lambda>x. \<bar>f x\<bar> powr p) powr (1 / p)

goal (1 subgoal):
 1. \<bar>expectation f\<bar> \<le> expectation (\<lambda>x. \<bar>f x\<bar> powr p) powr (1 / p)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(\<bar>expectation f\<bar> powr p) powr (1 / p) \<le> expectation (\<lambda>x. \<bar>f x\<bar> powr p) powr (1 / p)
[PROOF STEP]
show "abs(\<integral>x. f x \<partial>M) \<le> (\<integral>x. \<bar>f x\<bar> powr p \<partial>M) powr (1/p)"
[PROOF STATE]
proof (prove)
using this:
(\<bar>expectation f\<bar> powr p) powr (1 / p) \<le> expectation (\<lambda>x. \<bar>f x\<bar> powr p) powr (1 / p)

goal (1 subgoal):
 1. \<bar>expectation f\<bar> \<le> expectation (\<lambda>x. \<bar>f x\<bar> powr p) powr (1 / p)
[PROOF STEP]
using \<open>p \<ge> 1\<close>
[PROOF STATE]
proof (prove)
using this:
(\<bar>expectation f\<bar> powr p) powr (1 / p) \<le> expectation (\<lambda>x. \<bar>f x\<bar> powr p) powr (1 / p)
1 \<le> p

goal (1 subgoal):
 1. \<bar>expectation f\<bar> \<le> expectation (\<lambda>x. \<bar>f x\<bar> powr p) powr (1 / p)
[PROOF STEP]
by (auto simp add: powr_powr)
[PROOF STATE]
proof (state)
this:
\<bar>expectation f\<bar> \<le> expectation (\<lambda>x. \<bar>f x\<bar> powr p) powr (1 / p)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
theorem Class_Union [simp]:
  "(\<Union>a\<in>S. Class a) = S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Union> (Class ` S) = S
[PROOF STEP]
by blast


[STATEMENT]
lemma intpow_mult_combine: "x > 0 \<Longrightarrow> x ^\<^sub>Z m * (x ^\<^sub>Z n * y) = x ^\<^sub>Z (m + n) * y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (0::'a) < x \<Longrightarrow> x ^\<^sub>Z m * (x ^\<^sub>Z n * y) = x ^\<^sub>Z (m + n) * y
[PROOF STEP]
by (simp add: intpow_plus)


[STATEMENT]
lemma path_aux1a:
 assumes "forward_terminating_path x"
   shows "x \<noteq> 0 \<longleftrightarrow> end_points x \<noteq> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x \<noteq> 0) = (end_points x \<noteq> 0)
[PROOF STEP]
using assms end_point_iff2 forward_terminating_iff1 end_point_iff1 galois_aux2
[PROOF STATE]
proof (prove)
using this:
forward_terminating_path x
path ?x \<Longrightarrow> is_point (end_points ?x) = has_end_points ?x
path ?x \<Longrightarrow> forward_terminating ?x = (has_end_points ?x \<or> ?x = 0)
path ?x \<Longrightarrow> is_point (end_points ?x) = (\<not> no_end_points ?x)
(?x \<cdot> - ?y = 0) = (?x \<le> ?y)

goal (1 subgoal):
 1. (x \<noteq> 0) = (end_points x \<noteq> 0)
[PROOF STEP]
by force


[STATEMENT]
lemma openin_components_locally_connected:
    "\<lbrakk>locally connected S; c \<in> components S\<rbrakk> \<Longrightarrow> openin (top_of_set S) c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>locally connected S; c \<in> components S\<rbrakk> \<Longrightarrow> openin (top_of_set S) c
[PROOF STEP]
using locally_connected_open_component openin_subtopology_self
[PROOF STATE]
proof (prove)
using this:
locally connected ?S = (\<forall>t c. openin (top_of_set ?S) t \<and> c \<in> components t \<longrightarrow> openin (top_of_set ?S) c)
openin (top_of_set ?S) ?S

goal (1 subgoal):
 1. \<lbrakk>locally connected S; c \<in> components S\<rbrakk> \<Longrightarrow> openin (top_of_set S) c
[PROOF STEP]
by blast


[STATEMENT]
lemma path_aux1b:
  assumes "backward_terminating_path y"
    shows "y \<noteq> 0 \<longleftrightarrow> start_points y \<noteq> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (y \<noteq> 0) = (start_points y \<noteq> 0)
[PROOF STEP]
using assms start_point_iff2 backward_terminating_iff1 start_point_iff1 galois_aux2
[PROOF STATE]
proof (prove)
using this:
backward_terminating_path y
path ?x \<Longrightarrow> is_point (start_points ?x) = has_start_points ?x
path ?x \<Longrightarrow> backward_terminating ?x = (has_start_points ?x \<or> ?x = 0)
path ?x \<Longrightarrow> is_point (start_points ?x) = (\<not> no_start_points ?x)
(?x \<cdot> - ?y = 0) = (?x \<le> ?y)

goal (1 subgoal):
 1. (y \<noteq> 0) = (start_points y \<noteq> 0)
[PROOF STEP]
by force


[STATEMENT]
lemma iTrigger_True_left[simp]: "(True. t' \<T> t I. Q t) = (I = {} \<or> (\<diamond> t1 I. \<box> t2 (I \<down>\<ge> t1). Q t2))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (True. t' \<T> t I. Q t) = (I = {} \<or> (\<diamond> t1 I. \<box> t2 I \<down>\<ge> t1. Q t2))
[PROOF STEP]
unfolding iTL_defs
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<forall>t\<in>I. Q t) \<or> (\<exists>t\<in>I. True \<and> Ball (I \<down>\<ge> t) Q)) = (I = {} \<or> (\<exists>t\<in>I. Ball (I \<down>\<ge> t) Q))
[PROOF STEP]
by blast


[STATEMENT]
lemma phull_row_echelon:
  assumes "Keys (set ps) \<subseteq> set ts" and "distinct ts"
  shows "phull (set (mat_to_polys ts (row_echelon (polys_to_mat ts ps)))) = phull (set ps)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. phull (set (mat_to_polys ts (row_echelon (polys_to_mat ts ps)))) = phull (set ps)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. phull (set (mat_to_polys ts (row_echelon (polys_to_mat ts ps)))) = phull (set ps)
[PROOF STEP]
have len_ts: "length ts = dim_col (row_echelon (polys_to_mat ts ps))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length ts = dim_col (row_echelon (polys_to_mat ts ps))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
length ts = dim_col (row_echelon (polys_to_mat ts ps))

goal (1 subgoal):
 1. phull (set (mat_to_polys ts (row_echelon (polys_to_mat ts ps)))) = phull (set ps)
[PROOF STEP]
have *: "Keys (set (mat_to_polys ts (row_echelon (polys_to_mat ts ps)))) \<subseteq> set ts"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Keys (set (mat_to_polys ts (row_echelon (polys_to_mat ts ps)))) \<subseteq> set ts
[PROOF STEP]
by (fact Keys_mat_to_polys)
[PROOF STATE]
proof (state)
this:
Keys (set (mat_to_polys ts (row_echelon (polys_to_mat ts ps)))) \<subseteq> set ts

goal (1 subgoal):
 1. phull (set (mat_to_polys ts (row_echelon (polys_to_mat ts ps)))) = phull (set ps)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. phull (set (mat_to_polys ts (row_echelon (polys_to_mat ts ps)))) = phull (set ps)
[PROOF STEP]
by (simp only: row_space_eq_phull[OF *, symmetric] mat_to_polys_to_mat[OF assms(2) len_ts],
        rule row_space_row_echelon_eq_phull, fact)
[PROOF STATE]
proof (state)
this:
phull (set (mat_to_polys ts (row_echelon (polys_to_mat ts ps)))) = phull (set ps)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma p_antitone:
  "x \<le> y \<Longrightarrow> -y \<le> -x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<le> y \<Longrightarrow> - y \<le> - x
[PROOF STEP]
by (metis inf_commute order_trans pseudo_complement pp_increasing)


[STATEMENT]
lemma cong_mult_self_right:
  "[b * a = 0] (mod a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. [b * a = 0::'a] (mod a)
[PROOF STEP]
by (simp add: cong_def)


[STATEMENT]
lemma sigma_algebra_trivial: "sigma_algebra \<Omega> {{}, \<Omega>}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sigma_algebra \<Omega> {{}, \<Omega>}
[PROOF STEP]
by unfold_locales(fastforce intro: exI[where x="{{}}"] exI[where x="{\<Omega>}"])+


[STATEMENT]
lemma one_dim_onorm':
  fixes f :: "'a::one_dim \<Rightarrow> 'b::one_dim"
  assumes "clinear f"
  shows "onorm f = cmod (one_dim_iso (f 1))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. onorm f = cmod (one_dim_iso (f (1::'a)))
[PROOF STEP]
using assms one_dim_norm one_dim_onorm
[PROOF STATE]
proof (prove)
using this:
clinear f
norm ?x = cmod (one_dim_iso ?x)
clinear ?f \<Longrightarrow> onorm ?f = norm (?f (1::?'a))

goal (1 subgoal):
 1. onorm f = cmod (one_dim_iso (f (1::'a)))
[PROOF STEP]
by fastforce


[STATEMENT]
lemma path_concatenation_cycle_free_complete:
  assumes "forward_terminating_path x"
      and "backward_terminating_path y"
      and "end_points x = start_points y"
      and "x;1 \<cdot> y\<^sup>T;1 = 0"
    shows "path (x+y) \<and> start_points (x+y) = start_points x \<and> end_points (x+y) = end_points y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. path (x + y) \<and> start_points (x + y) = start_points x \<and> end_points (x + y) = end_points y
[PROOF STEP]
using assms path_concatenation_cycle_free path_concatenation_end_points path_concatenation_start_points
[PROOF STATE]
proof (prove)
using this:
forward_terminating_path x
backward_terminating_path y
end_points x = start_points y
x ; 1 \<cdot> y\<^sup>T ; 1 = 0
\<lbrakk>forward_terminating_path ?x; backward_terminating_path ?y; end_points ?x = start_points ?y; ?x ; 1 \<cdot> ?y\<^sup>T ; 1 = 0\<rbrakk> \<Longrightarrow> path (?x + ?y)
\<lbrakk>end_points ?x = start_points ?y; ?x ; 1 \<cdot> ?y\<^sup>T ; 1 = 0\<rbrakk> \<Longrightarrow> end_points (?x + ?y) = end_points ?y
\<lbrakk>end_points ?x = start_points ?y; ?x ; 1 \<cdot> ?y\<^sup>T ; 1 = 0\<rbrakk> \<Longrightarrow> start_points (?x + ?y) = start_points ?x

goal (1 subgoal):
 1. path (x + y) \<and> start_points (x + y) = start_points x \<and> end_points (x + y) = end_points y
[PROOF STEP]
by blast


[STATEMENT]
lemma deg_smult [simp]:
  assumes R: "a \<in> carrier R" "p \<in> carrier P"
  shows "deg R (a \<odot>\<^bsub>P\<^esub> p) = (if a = \<zero> then 0 else deg R p)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. deg R (a \<odot>\<^bsub>P\<^esub> p) = (if a = \<zero> then 0 else deg R p)
[PROOF STEP]
proof (rule le_antisym)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. deg R (a \<odot>\<^bsub>P\<^esub> p) \<le> (if a = \<zero> then 0 else deg R p)
 2. (if a = \<zero> then 0 else deg R p) \<le> deg R (a \<odot>\<^bsub>P\<^esub> p)
[PROOF STEP]
show "deg R (a \<odot>\<^bsub>P\<^esub> p) \<le> (if a = \<zero> then 0 else deg R p)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. deg R (a \<odot>\<^bsub>P\<^esub> p) \<le> (if a = \<zero> then 0 else deg R p)
[PROOF STEP]
using R
[PROOF STATE]
proof (prove)
using this:
a \<in> carrier R
p \<in> carrier P

goal (1 subgoal):
 1. deg R (a \<odot>\<^bsub>P\<^esub> p) \<le> (if a = \<zero> then 0 else deg R p)
[PROOF STEP]
by (rule deg_smult_ring)
[PROOF STATE]
proof (state)
this:
deg R (a \<odot>\<^bsub>P\<^esub> p) \<le> (if a = \<zero> then 0 else deg R p)

goal (1 subgoal):
 1. (if a = \<zero> then 0 else deg R p) \<le> deg R (a \<odot>\<^bsub>P\<^esub> p)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (if a = \<zero> then 0 else deg R p) \<le> deg R (a \<odot>\<^bsub>P\<^esub> p)
[PROOF STEP]
show "(if a = \<zero> then 0 else deg R p) \<le> deg R (a \<odot>\<^bsub>P\<^esub> p)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (if a = \<zero> then 0 else deg R p) \<le> deg R (a \<odot>\<^bsub>P\<^esub> p)
[PROOF STEP]
proof (cases "a = \<zero>")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. a = \<zero> \<Longrightarrow> (if a = \<zero> then 0 else deg R p) \<le> deg R (a \<odot>\<^bsub>P\<^esub> p)
 2. a \<noteq> \<zero> \<Longrightarrow> (if a = \<zero> then 0 else deg R p) \<le> deg R (a \<odot>\<^bsub>P\<^esub> p)
[PROOF STEP]
qed (simp, simp add: deg_belowI lcoeff_nonzero_deg integral_iff R)
[PROOF STATE]
proof (state)
this:
(if a = \<zero> then 0 else deg R p) \<le> deg R (a \<odot>\<^bsub>P\<^esub> p)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma bal_all_subtrees_equal: "bal (Node ts t) \<Longrightarrow> (\<forall>s1 \<in> set (subtrees ts). \<forall>s2 \<in> set (subtrees ts). height s1 = height s2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bal (Node ts t) \<Longrightarrow> \<forall>s1\<in>set (subtrees ts). \<forall>s2\<in>set (subtrees ts). height s1 = height s2
[PROOF STEP]
by (metis BTree.bal.simps(2))


[STATEMENT]
lemma Busemann_function_Lipschitz [mono_intros]:
  "abs(Busemann_function_at xi x y - Busemann_function_at xi x' y') \<le> dist x x' + dist y y'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<bar>Busemann_function_at xi x y - Busemann_function_at xi x' y'\<bar> \<le> dist x x' + dist y y'
[PROOF STEP]
using Busemann_function_mono[of xi x y x' y'] Busemann_function_mono[of xi x' y' x y]
[PROOF STATE]
proof (prove)
using this:
Busemann_function_at xi x y \<le> Busemann_function_at xi x' y' + dist x x' + dist y y'
Busemann_function_at xi x' y' \<le> Busemann_function_at xi x y + dist x' x + dist y' y

goal (1 subgoal):
 1. \<bar>Busemann_function_at xi x y - Busemann_function_at xi x' y'\<bar> \<le> dist x x' + dist y y'
[PROOF STEP]
by (simp add: dist_commute)


[STATEMENT]
lemma ccw_minus3: "\<not> coll a b c \<Longrightarrow> ccw (x - a) (x - b) (x - c) \<longleftrightarrow> ccw a b c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. det3 a b c \<noteq> 0 \<Longrightarrow> ccw (x - a) (x - b) (x - c) = ccw a b c
[PROOF STEP]
by (simp add: ccw_def coll_minus_eq)


[STATEMENT]
lemma convolution_emeasure_3:
  assumes [simp, measurable]: "A \<in> sets borel"
  assumes [simp]: "finite_measure M" "finite_measure N" "finite_measure L"
  assumes [simp]: "sets N = sets borel" "sets M = sets borel" "sets L = sets borel"
  shows "emeasure (L \<star> (M \<star> N )) A = \<integral>\<^sup>+x. \<integral>\<^sup>+y. \<integral>\<^sup>+z. indicator A (x + y + z) \<partial>N \<partial>M \<partial>L"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. emeasure (L \<star> (M \<star> N)) A = \<integral>\<^sup>+ x. \<integral>\<^sup>+ y. \<integral>\<^sup>+ z. indicator A (x + y + z) \<partial>N \<partial>M \<partial>L
[PROOF STEP]
apply (subst nn_integral_indicator[symmetric], simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integral\<^sup>N (L \<star> (M \<star> N)) (indicator A) = \<integral>\<^sup>+ x. \<integral>\<^sup>+ y. \<integral>\<^sup>+ z. indicator A (x + y + z) \<partial>N \<partial>M \<partial>L
[PROOF STEP]
apply (subst nn_integral_convolution,
        auto intro!: borel_measurable_indicator borel_measurable_indicator' convolution_finite)+
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<integral>\<^sup>+ x. \<integral>\<^sup>+ xa. \<integral>\<^sup>+ y. indicator A (x + (xa + y)) \<partial>N \<partial>M \<partial>L = \<integral>\<^sup>+ x. \<integral>\<^sup>+ y. \<integral>\<^sup>+ z. indicator A (x + y + z) \<partial>N \<partial>M \<partial>L
[PROOF STEP]
by (rule nn_integral_cong)+ (auto simp: semigroup_add_class.add.assoc)


[STATEMENT]
lemma times_complex_interval_tendsto:
  "A \<longlonglongrightarrow>\<^sub>c a \<Longrightarrow> B \<longlonglongrightarrow>\<^sub>c b \<Longrightarrow> (\<lambda>i. A i * B i) \<longlonglongrightarrow>\<^sub>c a * b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>A \<longlonglongrightarrow>\<^sub>c a; B \<longlonglongrightarrow>\<^sub>c b\<rbrakk> \<Longrightarrow> (\<lambda>i. A i * B i) \<longlonglongrightarrow>\<^sub>c a * b
[PROOF STEP]
unfolding complex_interval_tendsto_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>(Re_interval \<circ> A) \<longlonglongrightarrow>\<^sub>i Re a \<and> (Im_interval \<circ> A) \<longlonglongrightarrow>\<^sub>i Im a; (Re_interval \<circ> B) \<longlonglongrightarrow>\<^sub>i Re b \<and> (Im_interval \<circ> B) \<longlonglongrightarrow>\<^sub>i Im b\<rbrakk> \<Longrightarrow> (Re_interval \<circ> (\<lambda>i. A i * B i)) \<longlonglongrightarrow>\<^sub>i Re (a * b) \<and> (Im_interval \<circ> (\<lambda>i. A i * B i)) \<longlonglongrightarrow>\<^sub>i Im (a * b)
[PROOF STEP]
by (auto intro!: minus_interval_tendsto times_interval_tendsto plus_interval_tendsto
    simp: o_def Re_interval_times Im_interval_times)


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